.vimrc: +vim-fugitive
[nethome.git] / bin / shutdown-detect-boot
1 #! /bin/bash
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
5 sleep 60
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
9   exit 0
10 fi
11 echo "$(date --iso=seconds) unclean shutdown"|tee -a /var/log/shutdown-detect.log|mail -s "unclean shutdown: $(hostname)" jan@jankratochvil.net