mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-02 13:04:11 +08:00
replace ncutil.Log/PrintLog with logger.Log
This commit is contained in:
committed by
0xdcarns
parent
28efa45419
commit
11b1098390
@@ -3,6 +3,7 @@ package wireguard
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gravitl/netmaker/logger"
|
||||
"github.com/gravitl/netmaker/netclient/ncutils"
|
||||
)
|
||||
|
||||
@@ -14,7 +15,7 @@ func ApplyWindowsConf(confPath string) error {
|
||||
copyConfPath := fmt.Sprintf("%s\\%s", ncutils.WINDOWS_WG_DPAPI_PATH, pathStrings[1])
|
||||
err := ncutils.Copy(confPath, copyConfPath)
|
||||
if err != nil {
|
||||
ncutils.PrintLog(err.Error(), 1)
|
||||
logger.Log(err.Error(), 1)
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -28,7 +29,7 @@ func ApplyWindowsConf(confPath string) error {
|
||||
// RemoveWindowsConf - removes the WireGuard configuration file on Windows and dpapi file
|
||||
func RemoveWindowsConf(ifacename string, printlog bool) error {
|
||||
if _, err := ncutils.RunCmd("wireguard.exe /uninstalltunnelservice "+ifacename, printlog); err != nil {
|
||||
ncutils.PrintLog(err.Error(), 1)
|
||||
logger.Log(1, err.Error())
|
||||
}
|
||||
/*
|
||||
dpapipath := fmt.Sprintf("%s\\%s.conf.dpapi", ncutils.WINDOWS_WG_DPAPI_PATH, ifacename)
|
||||
@@ -36,14 +37,14 @@ func RemoveWindowsConf(ifacename string, printlog bool) error {
|
||||
if ncutils.FileExists(confpath) {
|
||||
err := os.Remove(confpath)
|
||||
if err != nil {
|
||||
ncutils.PrintLog(err.Error(), 1)
|
||||
logger.Log(err.Error(), 1)
|
||||
}
|
||||
}
|
||||
time.Sleep(time.Second >> 2)
|
||||
if ncutils.FileExists(dpapipath) {
|
||||
err := os.Remove(dpapipath)
|
||||
if err != nil {
|
||||
ncutils.PrintLog(err.Error(), 1)
|
||||
logger.Log(err.Error(), 1)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user