Merge pull request #63 from FadeMind/master

automatic systemd NetworkManager service restart
This commit is contained in:
Steven Black 2016-01-29 09:48:30 -05:00
commit b7a7174c1f

3
updateHostsFile.py Executable file → Normal file
View File

@ -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' )