check_amavis.sh: restart entire server if at least two checks failed.
This commit is contained in:
26
OLD/check_amavis.sh.00
Executable file
26
OLD/check_amavis.sh.00
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user