a6d8c822ee0f9f3db3859f7c3e4e40607b701cc1
[distro-setup] / check-stale-alerts
1 #!/bin/bash
2
3 time_arg="-ctime +4"
4 case $1 in
5 now)
6 time_arg=
7 ;;
8 esac
9
10 if [[ ! -e /dev/shm/iank-status ]]; then
11 exit 0
12 fi
13 eval $(< /dev/shm/iank-status)
14
15 if [[ $HOSTNAME != "$MAIL_HOST" ]]; then
16 exit 0
17 fi
18 out=$(find /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f -ctime +4)
19 if [[ $out ]]; then
20 echo HOSTNAME: $HOSTNAME
21 printf "%s\n" "$out"
22 fi
23 for h in {li,bk,je}.b8.nz; do
24 out=$(ssh $h find /m/md/bounces/new /var/local/cron-errors /home/iank/cron-errors /sysd-mail-once-state -type f)
25 if [[ $out ]]; then
26 echo $h:
27 printf "%s\n" "$out"
28 fi
29 done