Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
Your IP : 3.133.136.95
# log shutdowns and reboots to the console (/dev/console)
# this is useful for correlating logs
start on runlevel PREVLEVEL=2
task
console output
script
# runlevel(7) says INIT_HALT will be set to HALT or POWEROFF
date=$(date --utc)
case "$RUNLEVEL:$INIT_HALT" in
6:*) mode="reboot";;
0:HALT) mode="halt";;
0:POWEROFF) mode="poweroff";;
0:*) mode="shutdown-unknown";;
esac
{ read seconds idle < /proc/uptime; } 2>/dev/null || :
echo "$date: shutting down for $mode${seconds:+ [up ${seconds%.*}s]}."
end script
|