Fix output and exit status when daily_mailq_shorten is set to YES

PR:		conf/93472
Approved by:	re (scottl)
This commit is contained in:
matteo 2006-03-12 18:42:11 +00:00
parent 329792fe00
commit f17126d605

View File

@ -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
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])
@ -42,18 +43,19 @@ case "$daily_status_mailq_enable" in
echo ""
echo "Mail in submit queue:"
rc=$(case "$daily_status_mailq_shorten" in
rc_submit=$(case "$daily_status_mailq_shorten" in
[Yy][Ee][Ss])
mailq -Ac |
egrep -e '^[[:space:]]+[^[:space:]]+@' |
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 -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;;