From 04a89b32881aacfceb52b3ae9ca086b0667b368a Mon Sep 17 00:00:00 2001 From: afiniel Date: Fri, 17 Jan 2025 14:42:56 +0100 Subject: [PATCH] Add ask_reboot Func --- install/create_user.sh | 2 ++ install/functions.sh | 8 ++++++++ yiimp_single/start.sh | 5 +---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/install/create_user.sh b/install/create_user.sh index 8bb0e06..bad44d1 100644 --- a/install/create_user.sh +++ b/install/create_user.sh @@ -144,6 +144,7 @@ if [[ ("$UsingSSH" == "yes") ]]; then echo echo -e "$RED Please reboot the system and log in as$GREEN ${yiimpadmin} $YELLOW and type$GREEN yiimpool$YELLOW to$GREEN continu$YELLOW setup...$NC" exit 0 + ask_reboot fi # New User Password Login Creation @@ -260,6 +261,7 @@ case $response in echo echo -e "$RED Please reboot the system and log in as:$GREEN ${yiimpadmin} $YELLOW and type$GREEN yiimpool$YELLOW to$GREEN continu$YELLOW setup...$NC" exit 0 + ask_reboot ;; 1) diff --git a/install/functions.sh b/install/functions.sh index d6c396b..4d2a519 100644 --- a/install/functions.sh +++ b/install/functions.sh @@ -91,6 +91,14 @@ function install_end_message() { } +# A function to ask if the user wants to reboot the system +function ask_reboot() { + read -p "Do you want to reboot the system? (y/n): " reboot_choice + if [[ "$reboot_choice" == "y" ]]; then + sudo reboot + fi +} + function term_art() { clear diff --git a/yiimp_single/start.sh b/yiimp_single/start.sh index 1ff4e56..70e1bef 100644 --- a/yiimp_single/start.sh +++ b/yiimp_single/start.sh @@ -111,10 +111,7 @@ print_message() { } term_yiimpool - -# Call print_message regardless of UsingDomain print_message - exit 0 - +ask_reboot