HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux mail.btech-izolacje.pl 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
User: pewna6876 (1017)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //snap/core/17212/etc/init/cloud-log-shutdown.conf
# 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