Browse Source

Add delay parameter to v-restart-system

Kristan Kenney 6 years ago
parent
commit
92fda42e56
1 changed files with 6 additions and 1 deletions
  1. 6 1
      bin/v-restart-system

+ 6 - 1
bin/v-restart-system

@@ -11,6 +11,7 @@
 
 # Argument definition
 restart=$1
+delay=$2
 
 # Includes
 source $HESTIA/func/main.sh
@@ -20,7 +21,7 @@ source $HESTIA/func/main.sh
 #                    Verifications                         #
 #----------------------------------------------------------#
 
-check_args '1' "$#" 'RESTART'
+check_args '1' "$#" 'RESTART [DELAY]'
 
 
 # Perform verification if read-only mode is enabled
@@ -31,6 +32,10 @@ check_hestia_demo_mode
 #----------------------------------------------------------#
 
 if [  "$restart" = 'yes' ]; then
+    if [ "$delay" ]; then
+        echo "The server will restart in $delay seconds..."
+        sleep $delay
+    fi
     /sbin/reboot
 fi