[Proxmox Timed Shutdown]

- Ammended based on live test
This commit is contained in:
2022-05-16 20:21:50 +01:00
parent 0bece429b6
commit 333fe4bf71
+5 -4
View File
@@ -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