mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-03-25 23:30:41 +01:00
cmd/cli: save DNS settings only once
While at it, also fixing a bug in getting saved nameservers.
This commit is contained in:
committed by
Cuong Manh Le
parent
d55563cac5
commit
18e8616834
@@ -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