Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
LinkLeong authored Dec 10, 2022
1 parent 7564328 commit 062d95c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions service/system.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package service

import (
"errors"
"fmt"
"io/ioutil"
net2 "net"
Expand Down Expand Up @@ -63,8 +64,15 @@ func (c *systemService) GetMacAddress() (string, error) {
if err != nil {
return "", err
}
inter := interfaces[0]
return inter.HardwareAddr, nil
nets := MyService.System().GetNet(true)
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) {
Expand Down

0 comments on commit 062d95c

Please sign in to comment.