1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: sauce
# Required-Start: $remote_fs $syslog $named $time $network
# Required-Stop: $remote_fs $syslog $named $time $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start or stop SAUCE
### END INIT INFO
test -x /usr/sbin/sauce-run || exit 0
. /etc/sauce/sys-config
set -e
case "$1" in
start)
if sauceadmin '' 2>/dev/null >/dev/null; then exit 0; fi
echo Starting smapblocking mail receiver: sauce.
/usr/sbin/sauce-run &
;;
stop)
echo -n "Stopping spamblocking mail receiver: "
set +e
sauceadmin --sauceadmin-connrefused-ok=true shutdown
set -e
echo -n sauce
start-stop-daemon --stop -oq --retry 30 -u mail -n sauce
echo "."
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n "Reloading sauce configuration..."
sauceadmin --sauceadmin-connrefused-ok=true readconfig || test $? = 1
echo "done."
;;
force-reload)
$0 reload
;;
*)
echo "Usage: /etc/init.d/sauce {start|stop|reload|restart|force-reload}" >&2
exit 1
;;
esac
exit 0
|