mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-02 13:04:11 +08:00
Merge branch 'develop' of https://github.com/gravitl/netmaker into bugfixes_v0.10.0_various2
This commit is contained in:
@@ -177,12 +177,12 @@ func InitWireguard(node *models.Node, privkey string, peers []wgtypes.PeerConfig
|
|||||||
ncutils.PrintLog("waiting for interface...", 1) // ensure interface is created
|
ncutils.PrintLog("waiting for interface...", 1) // ensure interface is created
|
||||||
output, _ := ncutils.RunCmd("wg", false)
|
output, _ := ncutils.RunCmd("wg", false)
|
||||||
starttime := time.Now()
|
starttime := time.Now()
|
||||||
ifaceReady := !strings.Contains(output, ifacename)
|
ifaceReady := strings.Contains(output, ifacename)
|
||||||
for !ifaceReady && !(time.Now().After(starttime.Add(time.Second << 4))) {
|
for !ifaceReady && !(time.Now().After(starttime.Add(time.Second << 4))) {
|
||||||
output, _ = ncutils.RunCmd("wg", false)
|
output, _ = ncutils.RunCmd("wg", false)
|
||||||
err = ApplyConf(node, ifacename, confPath)
|
err = ApplyConf(node, ifacename, confPath)
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
ifaceReady = !strings.Contains(output, ifacename)
|
ifaceReady = strings.Contains(output, ifacename)
|
||||||
}
|
}
|
||||||
newDevice, devErr := wgclient.Device(deviceiface)
|
newDevice, devErr := wgclient.Device(deviceiface)
|
||||||
if !ifaceReady || devErr != nil {
|
if !ifaceReady || devErr != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user