From e88221f8e6a4bfbb3c8d6a632e418a68535bcab7 Mon Sep 17 00:00:00 2001 From: pengwang <969753572@qq.com> Date: Sun, 20 Jun 2021 21:43:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A1=E3=80=81=E5=8E=BB?= =?UTF-8?q?=E6=8E=89network=E4=B8=ADethtool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + setting/network.go | 16 +++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index c6357d6..682efd0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ selfpara/ log/ .DS_Store openGW +openGW.exe diff --git a/setting/network.go b/setting/network.go index 5fb5330..094818f 100644 --- a/setting/network.go +++ b/setting/network.go @@ -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) + //} } //获取当前网络参数