else
if [[ -s $statefile ]]; then
logsec=$(date +%s -d "$(head -n1 $statefile | awk '{print $1,$2}')")
- nowsec=$(date +%s)
- if (( logsec < nowsec - 60*60*48 )); then
- echo $0: host $h ssh /usr/local/bin/check-mailq fail for over 48 hours
+ case h in
+ frodo)
+ hours=200
+ ;;
+ *)
+ hours=20
+ ;;
+ esac
+ if (( logsec < EPOCHSECONDS - 60*60*hours )); then
+ echo $0: host $h ssh /usr/local/bin/check-mailq fail for over $hours hours
fi
fi
printf "%s\n" "$c" | ts "%F %T" >> $statefile