Issue #117 — fix: restart network.service if applicable.

This commit is contained in:
Steven Black 2016-03-24 18:07:17 -04:00
parent a541505ed9
commit 97ef0fdded

View File

@ -457,6 +457,12 @@ def moveHostsFileIntoPlace(finalFile):
printFailure("Flushing the DNS Cache failed.") printFailure("Flushing the DNS Cache failed.")
else: else:
printSuccess("Flushing DNS by restarting dnsmasq succeeded") printSuccess("Flushing DNS by restarting dnsmasq succeeded")
if os.path.isfile("/usr/lib/systemd/system/networking.service"):
dnsCacheFound = True
if subprocess.call(["/usr/bin/sudo", "/usr/bin/systemctl", "restart", "networking.service"]):
printFailure("Flushing the DNS Cache failed.")
else:
printSuccess("Flushing DNS by restarting networking.service succeeded")
if not dnsCacheFound: if not dnsCacheFound:
printFailure("Unable to determine DNS management tool.") printFailure("Unable to determine DNS management tool.")
elif os.name == 'nt': elif os.name == 'nt':