From b19c8d2fcc1540312b520fc757d445026667a6ac Mon Sep 17 00:00:00 2001 From: matteo Date: Wed, 8 Mar 2006 17:26:53 +0000 Subject: [PATCH] Fix output and exit status when daily_mailq_shorten is set to YES PR: conf/93472 MFC after: 3 --- etc/periodic/daily/440.status-mailq | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/etc/periodic/daily/440.status-mailq b/etc/periodic/daily/440.status-mailq index 244ff6ed4172..b75e85829e69 100755 --- a/etc/periodic/daily/440.status-mailq +++ b/etc/periodic/daily/440.status-mailq @@ -29,11 +29,12 @@ case "$daily_status_mailq_enable" in sort | uniq -c | sort -nr | - awk '$1 > 1 {print $1, $2}';; + awk '$1 >= 1 {print $1, $2}';; *) mailq;; - esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l) - [ $rc -gt 1 ] && rc=1 || rc=0 + esac | tee /dev/stderr | + egrep -v '(mqueue is empty|Total requests)' | wc -l) + [ $rc -gt 0 ] && rc=1 || rc=0 case "$daily_status_include_submit_mailq" in [Yy][Ee][Ss]) @@ -49,11 +50,12 @@ case "$daily_status_mailq_enable" in sort | uniq -c | sort -nr | - awk '$1 > 1 {print $1, $2}';; + awk '$1 >= 1 {print $1, $2}';; *) mailq -Ac;; - esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l) - [ $rc_submit -gt 1 ] && rc=1 + esac | tee /dev/stderr | + egrep -v '(mqueue is empty|Total requests)' | wc -l) + [ $rc_submit -gt 0 ] && rc=1 fi;; esac fi;;