From: Zaur Molotnikov Date: Fri, 30 Oct 2015 10:18:08 +0000 (+0100) Subject: Fixed ubuntu hosts file relaod X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=05eef7214cb7ebfc424e8e1562252f6211fc3d68;p=stevenblack-hosts.git Fixed ubuntu hosts file relaod --- diff --git a/updateHostsFile.py b/updateHostsFile.py index a78825ddb..90de9d1cd 100755 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -294,8 +294,9 @@ def moveHostsFileIntoPlace(finalFile): if(subprocess.call(["/usr/bin/sudo", "killall", "-HUP", "mDNSResponder"])): printFailure("Flushing the DNS Cache failed.") else: - if(subprocess.call(["/usr/bin/sudo", "/etc/rc.d/init.d/nscd", "restart"])): - printFailure("Flushing the DNS Cache failed.") + if os.path.isfile("/etc/rc.d/init.d/nscd"): + if(subprocess.call(["/usr/bin/sudo", "/etc/rc.d/init.d/nscd", "restart"])): + printFailure("Flushing the DNS Cache failed.") elif (os.name == 'nt'): print ('Automatically moving the hosts file in place is not yet supported.') print ('Please move the generated file to %SystemRoot%\system32\drivers\etc\hosts')