From facba836c4db93c693ce956a783acf8424823e76 Mon Sep 17 00:00:00 2001 From: FadeMind Date: Fri, 29 Jan 2016 15:02:22 +0100 Subject: [PATCH] automatic systemd NetworkManager service restart --- updateHostsFile.py | 3 +++ 1 file changed, 3 insertions(+) mode change 100755 => 100644 updateHostsFile.py diff --git a/updateHostsFile.py b/updateHostsFile.py old mode 100755 new mode 100644 index 7dea797c5..9b202c217 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -324,6 +324,9 @@ def moveHostsFileIntoPlace( finalFile ): 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." ) + if os.path.isfile( "/usr/lib/systemd/system/NetworkManager.service" ): + if( subprocess.call(["/usr/bin/sudo", "/usr/bin/systemctl", "restart", "NetworkManager.service"] )): + 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' )