Ask user before reboot

this is useful when installing on bare metal, don't want to reboot
server since the instructions get lost
This commit is contained in:
Girish Ramakrishnan
2018-12-07 10:41:13 -08:00
parent 3bad9e523c
commit c71a429f61

View File

@@ -241,7 +241,12 @@ done
echo -e "\n\n${GREEN}Visit https://<IP> and accept the self-signed certificate to finish setup.${DONE}"
if [[ "${rebootServer}" == "true" ]]; then
echo -e "\n${RED}Rebooting this server now to let changes take effect.${DONE}\n"
systemctl stop mysql # sometimes mysql ends up having corrupt privilege tables
systemctl reboot
systemctl stop box mysql # sometimes mysql ends up having corrupt privilege tables
read -p "This server has to rebooted to apply all the settings. Reboot now ? [Y/n] " yn
yn=${yn:-y}
case $yn in
[Yy]* ) systemctl reboot;;
* ) exit;;
esac
fi