#!/bin/sh
#
# This script starts and stops the spampd daemon
#
# chkconfig: 2345 80 30
#
# description: spampd is a daemon process which uses SpamAssassin to check
# email messages for SPAM.
# Source function library.
# . /etc/rc.d/init.d/functions
# Source networking configuration.
# . /etc/sysconfig/network
# Check that networking is up.
# [ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/local/sbin/spampd ] ¦¦ exit 0
PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
# Set default spampd configuration.
SPAMPDOPTIONS="--user=spampd \
--group=spampd \
--nodetach \
--host=localhost:10025 \
--relayhost=localhost:10026"
# See how we were called.
case "$1" in
start)
# Start daemon.
echo -n "Starting spampd: "
spampd $SPAMPDOPTIONS &
RETVAL=$?
touch /var/run/spampd/spampd
echo
;;
stop)
# Stop daemons.
echo -n "Shutting down spampd: "
kill `cat /var/run/spampd.pid`
RETVAL=$?
rm -f /var/run/spampd/spampd
echo
;;
restart)
$0 stop
$0 start
;;
status)
status spampd
;;
*)
echo "Usage: $0 {start¦stop¦restart¦status}"
exit 1
esac
exit 0
|