1#!/bin/sh 2#
|
3# $FreeBSD: head/etc/periodic/daily/440.status-mailq 107674 2002-12-07 23:37:44Z keramida $
|
3# $FreeBSD: head/etc/periodic/daily/440.status-mailq 155422 2006-02-07 08:21:06Z matteo $ |
4# 5 6# If there is a global system configuration file, suck it in. 7# 8if [ -r /etc/defaults/periodic.conf ] 9then 10 . /etc/defaults/periodic.conf 11 source_periodic_confs 12fi 13 14case "$daily_status_mailq_enable" in 15 [Yy][Ee][Ss]) 16 if [ ! -x /usr/bin/mailq ] 17 then 18 echo '$daily_status_mailq_enable is set but /usr/bin/mailq' \ 19 "isn't executable" 20 rc=2 21 else 22 echo "" 23 echo "Mail in local queue:" 24 25 rc=$(case "$daily_status_mailq_shorten" in 26 [Yy][Ee][Ss]) 27 mailq | 28 egrep -e '^[[:space:]]+[^[:space:]]+@' | 29 sort | 30 uniq -c | 31 sort -nr | 32 awk '$1 > 1 {print $1, $2}';; 33 *) 34 mailq;; 35 esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l)
|
36 [ $rc -gt 1 ] && rc=1
|
36 [ $rc -gt 1 ] && rc=1 || rc=0 |
37 38 case "$daily_status_include_submit_mailq" in 39 [Yy][Ee][Ss]) 40 if [ -f /etc/mail/submit.cf ] 41 then 42 echo "" 43 echo "Mail in submit queue:" 44
|
45 rc=$(case "$daily_status_mailq_shorten" in
|
45 rc_submit=$(case "$daily_status_mailq_shorten" in |
46 [Yy][Ee][Ss]) 47 mailq -Ac | 48 egrep -e '^[[:space:]]+[^[:space:]]+@' | 49 sort | 50 uniq -c | 51 sort -nr | 52 awk '$1 > 1 {print $1, $2}';; 53 *) 54 mailq -Ac;; 55 esac | tee /dev/stderr | fgrep -v 'mqueue is empty' | wc -l)
|
56 [ $rc -gt 1 ] && rc=1
|
56 [ $rc_submit -gt 1 ] && rc=1 |
57 fi;; 58 esac 59 fi;; 60 61 *) rc=0;; 62esac 63 64exit $rc
|