Add in logic to restart NetworkManager if it is enabled.

This commit is contained in:
Joe Doss 2018-09-17 13:30:55 -05:00 committed by Chris Roberts
parent 7402823ad0
commit 80006251f4
1 changed files with 7 additions and 1 deletions

View File

@ -29,7 +29,13 @@ module VagrantPlugins
}
# Restart network
if (test -f /etc/init.d/network && /etc/init.d/network status &> /dev/null ); then
service network restart
elif (test -f /usr/lib/systemd/system/NetworkManager.service && systemctl is-enabled NetworkManager.service &> /dev/null ); then
systemctl restart NetworkManager.service
else
printf "Could not restart the network to set the new hostname!\n"
fi
EOH
end
end