From c71a429f61dd1454d21df2cb6dc6cc9f49daf92a Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 7 Dec 2018 10:41:13 -0800 Subject: [PATCH] Ask user before reboot this is useful when installing on bare metal, don't want to reboot server since the instructions get lost --- scripts/cloudron-setup | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/cloudron-setup b/scripts/cloudron-setup index 2abd45091..8522e5071 100755 --- a/scripts/cloudron-setup +++ b/scripts/cloudron-setup @@ -241,7 +241,12 @@ done echo -e "\n\n${GREEN}Visit https:// 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