Switch if statements, check for systemctl, and switch to is-active.
This commit is contained in:
parent
94954739b5
commit
c14a4a09f7
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue