Browse Source

apply saved config on start up

Matthew R. Kasun 3 years ago
parent
commit
4c634bc02f
1 changed files with 4 additions and 4 deletions
  1. 4 4
      netclient/functions/daemon.go

+ 4 - 4
netclient/functions/daemon.go

@@ -52,10 +52,10 @@ func Daemon() error {
 		cfg.Network = network
 		cfg.Network = network
 		cfg.ReadConfig()
 		cfg.ReadConfig()
 		serverSet[cfg.Server.Server] = cfg
 		serverSet[cfg.Server.Server] = cfg
-		//temporary code --- remove in version v0.13.0
-		removeHostDNS(network, ncutils.IsWindows())
-		// end of code to be removed in version v0.13.0
-		initialPull(cfg.Network)
+		if err := wireguard.ApplyConf(&cfg.Node, cfg.Node.Interface, ncutils.GetNetclientPathSpecific()+cfg.Node.Interface+".conf"); err != nil {
+			logger.Log(0, "failed to start ", cfg.Node.Interface, "wg interface", err.Error())
+		}
+		go initialPull(cfg.Network)
 	}
 	}
 
 
 	// == subscribe to all nodes for each on machine ==
 	// == subscribe to all nodes for each on machine ==