mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-14 05:40:50 +08:00
22 lines
522 B
Go
22 lines
522 B
Go
package wireguard
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/gravitl/netmaker/netclient/ncutils"
|
|
)
|
|
|
|
func ApplyWindowsConf(confPath string) error {
|
|
var commandLine = fmt.Sprintf(`wireguard.exe /installtunnelservice "%s"`, confPath)
|
|
if _, err := ncutils.RunCmdFormatted(commandLine, false); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func RemoveWindowsConf(ifacename string, printlog bool) error {
|
|
if _, err := ncutils.RunCmd("wireguard.exe /uninstalltunnelservice "+ifacename, printlog); err != nil {
|
|
return err
|
|
}
|
|
return nil
|
|
}
|