Simplified if statements.

This commit is contained in:
Joe Doss 2018-09-17 14:30:57 -05:00 committed by Chris Roberts
parent 80006251f4
commit 94954739b5
1 changed files with 2 additions and 2 deletions

View File

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