done (#750)
This commit is contained in:
parent
75643287a5
commit
062d95c1eb
1 changed files with 10 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
net2 "net"
|
net2 "net"
|
||||||
|
@ -63,8 +64,15 @@ func (c *systemService) GetMacAddress() (string, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
inter := interfaces[0]
|
nets := MyService.System().GetNet(true)
|
||||||
return inter.HardwareAddr, nil
|
for _, v := range interfaces {
|
||||||
|
for _, n := range nets {
|
||||||
|
if v.Name == n {
|
||||||
|
return v.HardwareAddr, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "", errors.New("not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *systemService) MkdirAll(path string) (int, error) {
|
func (c *systemService) MkdirAll(path string) (int, error) {
|
||||||
|
|
Loading…
Reference in a new issue