Switch if statements, check for systemctl, and switch to is-active.

This commit is contained in:
Joe Doss 2018-09-17 14:56:06 -05:00 committed by Chris Roberts
parent 94954739b5
commit c14a4a09f7
1 changed files with 3 additions and 3 deletions

View File

@ -29,10 +29,10 @@ module VagrantPlugins
} }
# Restart network # Restart network
if test -f /etc/init.d/network; then if (test -f /usr/bin/systemctl && systemctl -q is-active NetworkManager.service); then
service network restart
elif systemctl -q is-enabled NetworkManager.service; then
systemctl restart NetworkManager.service systemctl restart NetworkManager.service
elif test -f /etc/init.d/network; then
service network restart
else else
printf "Could not restart the network to set the new hostname!\n" printf "Could not restart the network to set the new hostname!\n"
fi fi