Dears please I need support regarding my script as you can find below my script to monitor my postfix mailq but when run my scripts I got this error :./queue.sh: line 17: [: : integer expression expected
please your support
#!/bin/bash
queuelength=`/usr/sbin/postqueue -p | tail -n1 | awk '{print $5}'`
queuecount=`echo $queuelength | grep "[0-9]"`
crit=100
if [ "$queuelength" -eq "$crit" ]; then
(echo open relay.mydomain.com 25
sleep 8
echo helo "my relay IP"
echo mail from:
postmaster@mydomain.com
sleep 2
echo rcpt to: '<tashman@mydomain.com>'
sleep 2
echo data
sleep 2
echo subject: Mail Queue Alert of Hosting server
echo
echo
echo This is a mail from Hosting Server There is a problem in Mail Queue Kindly check the server there are ${queuelength} mails in the queue
sleep 5
echo .
sleep 5
echo quit ) | telnet
fi
exit 35