2010-04-09 19:19:58 +02:00
|
|
|
#!/bin/sh
|
2010-04-24 23:07:02 +02:00
|
|
|
|
|
|
|
# Copyright (c) 2008-2010, Nishant Limbachia, Hoffman Estates, IL, USA
|
|
|
|
|
2010-04-09 19:19:58 +02:00
|
|
|
# /etc/rc.d/rc.amavisd
|
2010-04-24 23:07:02 +02:00
|
|
|
# start|stop|restart|status for amavisd-new
|
|
|
|
|
2010-04-09 19:19:58 +02:00
|
|
|
# For automatic startup at boot, call this script from rc.local
|
2010-04-24 23:07:02 +02:00
|
|
|
|
2010-04-09 19:19:58 +02:00
|
|
|
PIDFILE=/var/run/amavis/amavisd.pid
|
|
|
|
|
|
|
|
amavisd_start() {
|
|
|
|
if [ -x /etc/rc.d/rc.amavisd ]; then
|
|
|
|
if [ -f $PIDFILE ]; then
|
|
|
|
echo "amavisd-new daemon running with PID: $(cat $PIDFILE)"
|
|
|
|
echo "try /etc/rc.d/rc.amavisd stop|restart"
|
|
|
|
echo ""
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "Starting amavisd-new daemon"
|
|
|
|
/usr/sbin/amavisd start
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
amavisd_stop() {
|
|
|
|
if [ -f $PIDFILE ]; then
|
|
|
|
echo "Stopping amavisd-new daemon"
|
|
|
|
/usr/sbin/amavisd stop
|
|
|
|
else
|
|
|
|
echo "amavisd-new daemon is not running"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
amavisd_restart() {
|
|
|
|
echo "Restarting amavisd-new daemon"
|
|
|
|
/usr/sbin/amavisd reload
|
|
|
|
}
|
|
|
|
|
|
|
|
amavisd_status() {
|
|
|
|
echo "amavisd-new daemon running with PID: $(cat $PIDFILE)"
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
'start')
|
|
|
|
amavisd_start
|
|
|
|
;;
|
|
|
|
'stop')
|
|
|
|
amavisd_stop
|
|
|
|
;;
|
|
|
|
'restart')
|
|
|
|
amavisd_restart
|
|
|
|
;;
|
|
|
|
'status')
|
|
|
|
amavisd_status
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "USAGE: $0 start|stop|restart|status"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|