From 333fe4bf71a0853bce41dfc2abf62b7275b2c773 Mon Sep 17 00:00:00 2001 From: Dunestorm Date: Mon, 16 May 2022 20:21:50 +0100 Subject: [PATCH] [Proxmox Timed Shutdown] - Ammended based on live test --- ProxmoxTimedShutdown.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ProxmoxTimedShutdown.sh b/ProxmoxTimedShutdown.sh index a97abe1..a3cdd48 100644 --- a/ProxmoxTimedShutdown.sh +++ b/ProxmoxTimedShutdown.sh @@ -1,9 +1,10 @@ #!/bin/bash - CURRENT_TIME=$(date +%H:%M) -if [[ $CURRENT_TIME > "00:00" ]] && [[ $CURRENT_TIME < "8:30" ]]; then - echo "Triggering scheduled post-backup shutdown" - shutdown -P 01:00 +SCH_SHUTDOWN_TIME="01:00" + +if [[ $CURRENT_TIME > "00:00" ]] && [[ $CURRENT_TIME < "08:30" ]]; then + echo "Triggering scheduled post-backup shutdown at $SCH_SHUTDOWN_TIME" + shutdown -P $SCH_SHUTDOWN_TIME else echo "Automatic shutdown not triggered due to current time" fi \ No newline at end of file