mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 00:43:58 +08:00
fixing dns and various logs
This commit is contained in:
@@ -68,13 +68,12 @@ func JoinNetwork(cfg config.ClientConfig, privateKey string) error {
|
||||
cfg.Node.TrafficKeys.Server = nil
|
||||
// == end handle keys ==
|
||||
|
||||
if cfg.Node.LocalRange != "" && cfg.Node.LocalAddress == "" {
|
||||
log.Println("local vpn, getting local address from range: " + cfg.Node.LocalRange)
|
||||
cfg.Node.LocalAddress = getLocalIP(cfg.Node)
|
||||
} else if cfg.Node.LocalAddress == "" {
|
||||
if cfg.Node.LocalAddress == "" {
|
||||
intIP, err := getPrivateAddr()
|
||||
if err == nil {
|
||||
cfg.Node.LocalAddress = intIP
|
||||
} else {
|
||||
ncutils.PrintLog("error retrieving private address: "+err.Error(), 1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,6 +236,14 @@ func JoinNetwork(cfg config.ClientConfig, privateKey string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if node.DNSOn == "yes" {
|
||||
for _, server := range node.NetworkSettings.DefaultServerAddrs {
|
||||
if server.IsLeader {
|
||||
go local.SetDNSWithRetry(node.Interface, node.Network, server.Address)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if cfg.Daemon != "off" {
|
||||
err = daemon.InstallDaemon(cfg)
|
||||
}
|
||||
|
Reference in New Issue
Block a user