修改:1、去掉network中ethtool

This commit is contained in:
pengwang 2021-06-20 21:43:17 +08:00
parent 1139ef9ded
commit e88221f8e6
2 changed files with 8 additions and 9 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ selfpara/
log/
.DS_Store
openGW
openGW.exe

View File

@ -12,8 +12,6 @@ import (
"path/filepath"
"runtime"
"strings"
"github.com/safchain/ethtool"
)
type NetworkNameListTemplate struct {
@ -60,13 +58,13 @@ func (n *NetworkParamListTemplate) AddNetworkParam(param NetworkParamTemplate) e
func (n *NetworkParamTemplate) GetNetworkStatus() {
if runtime.GOOS == "linux" {
ethHandle, _ := ethtool.NewEthtool()
defer ethHandle.Close()
n.LinkStatus, _ = ethHandle.LinkState(n.Name)
Logger.Debugf("%v LinkStatus %v", n.Name, n.LinkStatus)
}
//if runtime.GOOS == "linux" {
// ethHandle, _ := ethtool.NewEthtool()
// defer ethHandle.Close()
//
// n.LinkStatus, _ = ethHandle.LinkState(n.Name)
// Logger.Debugf("%v LinkStatus %v", n.Name, n.LinkStatus)
//}
}
//获取当前网络参数