mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02:00
cmd/cli: add missing pre-run setup for start command
Otherwise, ctrld won't be able to reset DNS correctly if problems happened during self-check process.
This commit is contained in:
+1
-1
@@ -1061,7 +1061,7 @@ func uninstall(p *prog, s service.Service) {
|
|||||||
p.resetDNS(false, true)
|
p.resetDNS(false, true)
|
||||||
|
|
||||||
// Iterate over all physical interfaces and restore DNS if a saved static config exists.
|
// Iterate over all physical interfaces and restore DNS if a saved static config exists.
|
||||||
withEachPhysicalInterfaces("", "restore static DNS", func(i *net.Interface) error {
|
withEachPhysicalInterfaces(p.runningIface, "restore static DNS", func(i *net.Interface) error {
|
||||||
file := savedStaticDnsSettingsFilePath(i)
|
file := savedStaticDnsSettingsFilePath(i)
|
||||||
if _, err := os.Stat(file); err == nil {
|
if _, err := os.Stat(file); err == nil {
|
||||||
if err := restoreDNS(i); err != nil {
|
if err := restoreDNS(i); err != nil {
|
||||||
|
|||||||
@@ -234,6 +234,7 @@ NOTE: running "ctrld start" without any arguments will start already installed c
|
|||||||
mainLog.Load().Error().Msg(err.Error())
|
mainLog.Load().Error().Msg(err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
p.preRun()
|
||||||
|
|
||||||
status, err := s.Status()
|
status, err := s.Status()
|
||||||
isCtrldRunning := status == service.StatusRunning
|
isCtrldRunning := status == service.StatusRunning
|
||||||
|
|||||||
Reference in New Issue
Block a user