SHA256
1
0
forked from pool/postfix
postfix/check_mail_queue
Peter Varkoly b102dd3c5f - Remove rcpostfix symlink [jsc#PED-266]
- postfix-script requires cmp

- Remove rcpostfix symlink [jsc#PED-266] 

- postfix-script requires cmp

OBS-URL: https://build.opensuse.org/package/show/server:mail/postfix?expand=0&rev=494
2024-08-19 05:01:05 +00:00

25 lines
477 B
Bash

#!/bin/bash
nm()
{
NM=$( /usr/bin/mailq 2> /dev/null | tail -1 | /usr/bin/gawk '{ print $5 }' )
if [ "$NM" ]
then
return 0
else
return 1
fi
}
test -e /var/run/check_mail_queue.pid && exit;
echo $$ > /var/run/check_mail_queue.pid
while( nm )
do
/etc/init.d/postfix status || /etc/init.d/postfix start
sleep 10
/usr/sbin/postfix flush
done
/etc/init.d/postfix status && /etc/init.d/postfix stop
rm /var/run/check_mail_queue.pid