Fix file formats

This commit is contained in:
Matthew McKinnon 2016-06-06 16:28:56 +10:00
parent b822139730
commit b323ab96db

View File

@ -1,16 +1,16 @@
#!/bin/bash #!/bin/bash
# Checks mailQ size # Checks mailQ size
QUEUELIMIT=0
HOST=$(/bin/hostname)
QUEUELENGTH=$(/usr/sbin/postqueue -p | tail -n1 | awk '{print $5}')
QUEUECOUNT=$(echo $queuelength | grep "[0-9]")
SUBJECT="Mail Queue on $HOST is currently $QUEUECOUNT"
MAILTO="mmckinnon@comprofix.com"
if [ "$QUEUECOUNT" == "" ]; then QUEUELIMIT=0
exit; HOST=$(/bin/hostname)
elif [ "$QUEUECOUNT" -gt "$QUEUELIMIT" ]; then QUEUELENGTH=$(/usr/sbin/postqueue -p | tail -n1 | awk '{print $5}')
#echo $msg | /bin/mail -s "Mail Queue Alert $queuecount ($hostname)" "helpdesk@ambient-it.com.au" QUEUECOUNT=$(echo $queuelength | grep "[0-9]")
/usr/sbin/postqueue -p | /bin/mail -s "$SUBJECT" "$MAILTO" SUBJECT="Mail Queue on $HOST is currently $QUEUECOUNT"
fi MAILTO="mmckinnon@comprofix.com"
if [ "$QUEUECOUNT" == "" ]; then
exit;
elif [ "$QUEUECOUNT" -gt "$QUEUELIMIT" ]; then
#echo $msg | /bin/mail -s "Mail Queue Alert $queuecount ($hostname)" "helpdesk@ambient-it.com.au"
/usr/sbin/postqueue -p | /bin/mail -s "$SUBJECT" "$MAILTO"
fi