#! /bin/sh # Copyright (c) 2004 Roheim Technology, Norway # Website: http://www.roheim.com/ # Arthor: Einar Roheim # # Version 0.1 # # This script is provided as is, and Roheim Technology is not # resposible for any damage that it may create. # # Comments to support chkconfig # chkconfig: 35 90 20 # description: A very fast and reliable anti-spam engine. ### BEGIN INIT INFO # Provides: spamassassin # Default-Start: 3 5 # Default-Stop: 0 1 2 4 6 # Short-Description: Start and Stop SpamAssassin # Description: SpamAssassin is a very fast and reliable anti-spam engine. ### END INIT INFO PID_FILE=/var/run/spamad.pid SA_DAEMON_BIN=/usr/local/bin/spamd SA_DAEMON_ARG="0 -L -x -d -u nobody -r $PID_FILE -A 127.0.0.1" case "$1" in start) # # Starting the SpamAssassin Daemon. # echo "Starting SpamAssassin Daemon" `$SA_DAEMON_BIN $SA_DAEMON_ARG` ;; stop) # # Stopping the SpamAssassin Deamon. # echo "Stoping SpamAssassin Daemon" if test -s "$PID_FILE" then # Finding the pid for the daemon SA_DAEMON_PID=`cat $PID_FILE` # Killing the daemon echo " Killing SpamAssassin Daemon with pid $SA_DAEMON_PID" kill $SA_DAEMON_PID else echo " No SpamAssassin Daemon pid file found." fi ;; restart) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac exit 0