27 lines
554 B
Bash
Executable File
27 lines
554 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
_check_script="/root/bin/amavis_ckeck.pl"
|
|
|
|
if [ -x $_check_script ]; then
|
|
_check_result=`$_check_script --server 127.0.0.1 --from postmaster --to do-not-reply --port 10024`
|
|
_retval=$?
|
|
else
|
|
echo
|
|
echo "[ Error ]: Cannot find check script \"$_check_script\""
|
|
echo
|
|
exit 1
|
|
fi
|
|
|
|
if [ "$_retval" != "0" ]; then
|
|
echo
|
|
echo "[ Error ]: Amavis seems NOT to be running. trying to (re)start service.."
|
|
echo
|
|
|
|
/etc/init.d/amavis stop > /dev/null 2>&1
|
|
sleep 2
|
|
/etc/init.d/amavis start > /dev/null 2>&1
|
|
fi
|
|
|
|
|
|
exit 0
|