#!/bin/sh

stamp=`date +%s -r $(uci get weathermon.process.dump_file)`
now=`date +%s`
delta=$(( $now - $stamp ))
if [[ $delta -ge 300 ]]; then
  logger weathermon restarting...
  /etc/init.d/weathermon restart
fi

pgrep weather-lcd > /dev/null || /etc/init.d/lcd-weather restart