Skip to content

Commit 04a89b3

Browse files
committed
Add ask_reboot Func
1 parent e2b6919 commit 04a89b3

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

install/create_user.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ if [[ ("$UsingSSH" == "yes") ]]; then
144144
echo
145145
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"
146146
exit 0
147+
ask_reboot
147148
fi
148149

149150
# New User Password Login Creation
@@ -260,6 +261,7 @@ case $response in
260261
echo
261262
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"
262263
exit 0
264+
ask_reboot
263265
;;
264266

265267
1)

install/functions.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ function install_end_message() {
9191

9292
}
9393

94+
# A function to ask if the user wants to reboot the system
95+
function ask_reboot() {
96+
read -p "Do you want to reboot the system? (y/n): " reboot_choice
97+
if [[ "$reboot_choice" == "y" ]]; then
98+
sudo reboot
99+
fi
100+
}
101+
94102
function term_art() {
95103
clear
96104

yiimp_single/start.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,7 @@ print_message() {
111111
}
112112

113113
term_yiimpool
114-
115-
# Call print_message regardless of UsingDomain
116114
print_message
117-
118115
exit 0
119-
116+
ask_reboot
120117

0 commit comments

Comments
 (0)