2 boot="boot $* boot=$(uptime -s) $(uptime -p)"
3 echo "$(date --iso=seconds) uninit-time $boot" >>/var/log/shutdown-detect.log
4 # Raspberry Pi 3B+: 15 sec
6 echo "$(date --iso=seconds) init-time $boot" >>/var/log/shutdown-detect.log
7 if [ -e /var/log/shutdown-detect.ok ];then
8 rm -f /var/log/shutdown-detect.ok
11 echo "$(date --iso=seconds) unclean shutdown"|tee -a /var/log/shutdown-detect.log|mail -s "unclean shutdown: $(hostname)" jan@jankratochvil.net