chars+=("MAILPING!")
fi
- qlen=$(/usr/sbin/exim -bpc)
+ qlen=$(/usr/sbin/exiqgrep -o 60 -c -b | awk '{print $1}')
if ((qlen)); then
chars+=("q $qlen")
fi
spamcount=0
fi
if (( spamcount <= 4 )); then
- if grep -q 'spam acl condition' /var/log/exim4/paniclog; then
+ if grep -q 'spam acl condition' /var/log/exim4/paniclog &>/dev/null; then
printf . >>$loglog
fi
/a/bin/distro-setup/epanic-clean
fi
}
+# use this if we want to do something just once per minute
first_chars=()
power=true
power=false
fi
-if $power; then
- for h in tp.b8.nz vpn1 x2 x3.b8.nz frodo.b8.nz kd.b8.nz kw; do
- if [[ $HOSTNAME == ${h%%.*} ]]; then
- continue
- fi
- msg=
- if c=$(timeout 1 ssh $h exim -bpc 2>/dev/null) && [[ $c && $c != 0 ]]; then
- msg=q:$h=$c
- first_chars+=($msg)
- fi
- if [[ $1 ]]; then
- echo q: $h $c
- fi
- lo -1 remote-mailq $msg
- done
-fi
write-status
if [[ $1 ]]; then
cat $status_file