From 510aa679fa5dfccbf1fc90010171ea0a3ff10a2a Mon Sep 17 00:00:00 2001 From: h0x0er Date: Thu, 14 Jul 2022 10:50:50 +0530 Subject: [PATCH] reloading docker daemon instead of restarting --- dnsconfig.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dnsconfig.go b/dnsconfig.go index ecf6c51..2ed8a55 100644 --- a/dnsconfig.go +++ b/dnsconfig.go @@ -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 @@ -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