Skip to content

Commit

Permalink
reloading docker daemon instead of restarting
Browse files Browse the repository at this point in the history
  • Loading branch information
h0x0er committed Jul 14, 2022
1 parent 9d3f70b commit 510aa67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions dnsconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ func (d *DnsConfig) SetDockerDNSServer(cmd Command, configPath, tempDir string)
}

if cmd == nil {
cmd = exec.Command("/bin/sh", "-c", "sudo systemctl daemon-reload && sudo systemctl restart docker")
cmd = exec.Command("/bin/sh", "-c", "sudo systemctl daemon-reload && sudo systemctl reload docker")
}

err = cmd.Run()
if err != nil {
return fmt.Errorf(fmt.Sprintf("error re-starting docker: %v", err))
return fmt.Errorf(fmt.Sprintf("error reloading docker: %v", err))
}

return nil
Expand All @@ -186,12 +186,12 @@ func (d *DnsConfig) RevertDockerDNSServer(cmd Command, configPath string) error
}

if cmd == nil {
cmd = exec.Command("/bin/sh", "-c", "sudo systemctl daemon-reload && sudo systemctl restart docker")
cmd = exec.Command("/bin/sh", "-c", "sudo systemctl daemon-reload && sudo systemctl reload docker")
}

err = cmd.Run()
if err != nil {
return fmt.Errorf(fmt.Sprintf("error re-starting docker: %v", err))
return fmt.Errorf(fmt.Sprintf("error reloading docker: %v", err))
}
}
return nil
Expand Down

0 comments on commit 510aa67

Please sign in to comment.