mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-03 11:02:11 +08:00
fixing windows join issue
This commit is contained in:
@@ -109,6 +109,9 @@ func NodeUpdate(client mqtt.Client, msg mqtt.Message) {
|
||||
}
|
||||
if ifaceDelta { // if a change caused an ifacedelta we need to notify the server to update the peers
|
||||
ncutils.Log("applying WG conf to " + file)
|
||||
if ncutils.IsWindows() {
|
||||
wireguard.RemoveConfGraceful(nodeCfg.Node.Interface)
|
||||
}
|
||||
err = wireguard.ApplyConf(&nodeCfg.Node, nodeCfg.Node.Interface, file)
|
||||
if err != nil {
|
||||
ncutils.Log("error restarting wg after node update " + err.Error())
|
||||
|
||||
Binary file not shown.
@@ -192,6 +192,7 @@ func InitWireguard(node *models.Node, privkey string, peers []wgtypes.PeerConfig
|
||||
} else {
|
||||
_, devErr := wgclient.Device(deviceiface)
|
||||
if !ifaceReady || devErr != nil {
|
||||
fmt.Printf("%v\n", devErr)
|
||||
return fmt.Errorf("could not reliably create interface, please check wg installation and retry")
|
||||
}
|
||||
}
|
||||
@@ -287,7 +288,6 @@ func ApplyConf(node *models.Node, ifacename string, confPath string) error {
|
||||
var err error
|
||||
switch os {
|
||||
case "windows":
|
||||
RemoveConfGraceful(ifacename)
|
||||
ApplyWindowsConf(confPath)
|
||||
case "darwin":
|
||||
ApplyMacOSConf(node, ifacename, confPath)
|
||||
@@ -490,4 +490,5 @@ func RemoveConfGraceful(ifacename string) {
|
||||
break
|
||||
}
|
||||
}
|
||||
time.Sleep(time.Second << 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user