mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-04 00:17:21 +08:00
refactored clients
This commit is contained in:
@@ -199,6 +199,12 @@ func NodeUpdate(client mqtt.Client, msg mqtt.Message) {
|
||||
return
|
||||
}
|
||||
if ifaceDelta { // if a change caused an ifacedelta we need to notify the server to update the peers
|
||||
pubErr := publishClientPeers(&cfg)
|
||||
if pubErr != nil {
|
||||
ncutils.Log("could not notify server to update peers after interface change")
|
||||
} else {
|
||||
ncutils.Log("signalled peer update to server")
|
||||
}
|
||||
ncutils.Log("applying WG conf to " + file)
|
||||
err = wireguard.ApplyConf(&cfg.Node, cfg.Node.Interface, file)
|
||||
if err != nil {
|
||||
@@ -215,12 +221,6 @@ func NodeUpdate(client mqtt.Client, msg mqtt.Message) {
|
||||
}
|
||||
}
|
||||
}
|
||||
pubErr := publishClientPeers(&cfg)
|
||||
if pubErr != nil {
|
||||
ncutils.Log("could not notify server to update peers after interface change")
|
||||
} else {
|
||||
ncutils.Log("signalled peer update to server")
|
||||
}
|
||||
}
|
||||
//deal with DNS
|
||||
if newNode.DNSOn != "yes" && shouldDNSChange && cfg.Node.Interface != "" {
|
||||
|
Reference in New Issue
Block a user