Checks if the mailqueue is empty
by
Wyden Silvan
—
last modified
11.11.2009 12:05
#!/bin/sh
#script that looks if the mailqueue is emtpy or not. if the queue is empty, nothing happens. If not an e-amil with the queue is send.
mailq > /root/temp
if [ `cat /root/temp | wc -m` -gt 4 ]
then
#send an e-mail if the queue isn't empty
sendmail mymail@example.com < /root/temp
fi
rm -rf /root/temp
