X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=system-status;h=e137d06f3b4b15c44b884e6dc04e8eb17d0a3759;hb=42731222d4bf78b3b0f1b4d16f5fad2b010b51a1;hp=e01b15b6346af812f68779b88dcb4d2864f274de;hpb=2f7b266e782347022b68c5c8e8fbe9292492c343;p=distro-setup diff --git a/system-status b/system-status index e01b15b..e137d06 100755 --- a/system-status +++ b/system-status @@ -36,11 +36,12 @@ 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 + cd /b/ds if ! make -q ~/.local/distro-begin || [[ $(<~/.local/distro-begin) != 0 ]]; then chars+=("DISTRO-BEGIN!") fi @@ -51,7 +52,6 @@ write-status() { f=~/.local/conflink if [[ -e $f ]]; then - cd /b/ds now=$(date +%s) fsec=$(stat -c%Y $f) fmin=$(( (fsec - now ) / 60 + 1 )) @@ -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 && $(/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