DB "canary" added - with fail/restart when connection dropped
[weathermon.git] / bin / weather-watchdog
1 #!/bin/sh
2
3 stamp=`date +%s -r $(uci get weathermon.process.dump_file)`
4 now=`date +%s`
5 delta=$(( $now - $stamp ))
6 if [[ $delta -ge 300 ]]; then
7   logger weathermon restarting...
8   /etc/init.d/weathermon restart
9 fi
10
11 pgrep weather-lcd > /dev/null || /etc/init.d/lcd-weather restart