configurations/testbed/scripts/schedule-poweroff.sh
2023-04-28 15:11:16 +08:00

14 lines
280 B
Bash
Executable File

#!/bin/bash
set -ex
SKIP_FILE=/tmp/skip-poweroff
/bin/date
if [[ -f "$SKIP_FILE" ]]; then
echo "poweroff skipped for this time."
rm -rf "$SKIP_FILE"
else
/sbin/shutdown -h 60
wall "The system shutdown is scheduled in 1 hour. Use 'shutdown -c' to cancel."
fi
echo