reconf the master and common scripts and all unraid essential scripts# Please enter the commit message for your changes. Lines starting
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
#-----------------------------------------------------------------------------------------------
|
||||
#
|
||||
# User variables can be adjusted in Master.conf
|
||||
# This script is using the SLEEP Variable from Master.conf for the delay before reboot
|
||||
#
|
||||
# Scripts now just contain runtime logic
|
||||
#
|
||||
@@ -27,23 +26,25 @@ load_master_conf
|
||||
# Parse CLI args (flags + VAR=value)
|
||||
parse_args "$@"
|
||||
|
||||
# Validate SLEEP
|
||||
validate_int SLEEP "$SLEEP"
|
||||
# Validate REBOOT_SLEEP
|
||||
validate_int REBOOT_SLEEP "$REBOOT_SLEEP"
|
||||
|
||||
# --- Functions
|
||||
|
||||
notify_users() {
|
||||
wall "⚠️ Unraid server will reboot in ${SLEEP} second(s). Save your work."
|
||||
wall "⚠️ Unraid server will reboot in ${REBOOT_SLEEP} second(s). Save your work."
|
||||
}
|
||||
|
||||
# --- MAIN
|
||||
|
||||
echo "==== Scheduled Reboot Script Started: $(date) ===="
|
||||
|
||||
# Optional warning before reboot
|
||||
if [ "$SLEEP" -gt 0 ]; then
|
||||
if [ "$REBOOT_SLEEP" -gt 0 ]; then
|
||||
notify_users
|
||||
sleep "$SLEEP"
|
||||
sleep "$REBOOT_SLEEP"
|
||||
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
# Stop Docker
|
||||
|
||||
Reference in New Issue
Block a user