fixes
[distro-setup] / system-status
index e01b15b6346af812f68779b88dcb4d2864f274de..0ab88b4d533a4ee4f2d01e2a0751f6a63f658458 100755 (executable)
@@ -36,7 +36,7 @@ write-status() {
     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
@@ -82,7 +82,7 @@ write-status() {
     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
@@ -136,6 +136,7 @@ write-status() {
   fi
 
 }
+# use this if we want to do something just once per minute
 first_chars=()
 
 power=true
@@ -143,22 +144,6 @@ if [[ -e /sys/class/power_supply/AC/online && $(</sys/class/power_supply/AC/onli
   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