mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-09-04 13:36:35 +02:00
cmd/cli: save DNS settings only once
While at it, also fixing a bug in getting saved nameservers.
This commit is contained in:
@@ -268,6 +268,14 @@ func initCLI() {
|
||||
{s.Stop, false},
|
||||
{func() error { return doGenerateNextDNSConfig(nextdns) }, true},
|
||||
{func() error { return ensureUninstall(s) }, false},
|
||||
{func() error {
|
||||
// Save current DNS so we can restore later.
|
||||
withEachPhysicalInterfaces("", "save DNS settings", func(i *net.Interface) error {
|
||||
saveCurrentDNS(i)
|
||||
return nil
|
||||
})
|
||||
return nil
|
||||
}, false},
|
||||
{s.Install, false},
|
||||
{s.Start, true},
|
||||
// Note that startCmd do not actually write ControlD config, but the config file was
|
||||
|
||||
Reference in New Issue
Block a user