Skip to content

Commit 92fda42

Browse files
author
Kristan Kenney
committed
Add delay parameter to v-restart-system
1 parent 0062d02 commit 92fda42

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/v-restart-system

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
# Argument definition
1313
restart=$1
14+
delay=$2
1415

1516
# Includes
1617
source $HESTIA/func/main.sh
@@ -20,7 +21,7 @@ source $HESTIA/func/main.sh
2021
# Verifications #
2122
#----------------------------------------------------------#
2223

23-
check_args '1' "$#" 'RESTART'
24+
check_args '1' "$#" 'RESTART [DELAY]'
2425

2526

2627
# Perform verification if read-only mode is enabled
@@ -31,6 +32,10 @@ check_hestia_demo_mode
3132
#----------------------------------------------------------#
3233

3334
if [ "$restart" = 'yes' ]; then
35+
if [ "$delay" ]; then
36+
echo "The server will restart in $delay seconds..."
37+
sleep $delay
38+
fi
3439
/sbin/reboot
3540
fi
3641

0 commit comments

Comments
 (0)