Add in logic to restart NetworkManager if it is enabled.
This commit is contained in:
parent
7402823ad0
commit
80006251f4
|
@ -29,7 +29,13 @@ module VagrantPlugins
|
||||||
}
|
}
|
||||||
|
|
||||||
# Restart network
|
# Restart network
|
||||||
service network restart
|
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
|
EOH
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue