userspace implementation

This commit is contained in:
afeiszli
2021-09-21 21:35:52 -04:00
parent a7a45e60e1
commit 50250d5859
5 changed files with 22 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ import (
"runtime"
"strings"
"os/exec"
"os"
"github.com/gravitl/netmaker/netclient/ncutils"
)
@@ -54,9 +55,8 @@ func SetIPForwardingMac() error {
func IsWGInstalled() bool {
out, err := ncutils.RunCmd("wg help", true)
if err != nil {
_, err1 := exec.LookPath("wireguard-go")
_, err2 := exec.LookPath("boringtun")
return err1 == nil || err2 == nil
_, err = exec.LookPath(os.Getenv("WG_QUICK_USERSPACE_IMPLEMENTATION"))
return err == nil
}
return strings.Contains(out, "Available subcommand")
}