summaryrefslogtreecommitdiff
path: root/spamassassin/spamassassin.rc
blob: be9c1a6e5233ebc08f32030a89bbdb5e41ae7b25 (plain)
    1 #!/bin/sh
    2 ######################################################################
    3 # spamassassin: This script starts and stops the spamd daemon
    4 #  description: spamd is a daemon process which uses SpamAssassin
    5 #               to check email messages for SPAM. It is normally
    6 #               called by spamc from a MDA.
    7 ######################################################################
    8 
    9 daemon="/usr/bin/spamd"
   10 options="-d -c -a -m5 -H"
   11 
   12 ######################################################################
   13 # Start/Stop/Reload/Status Functions
   14 ######################################################################
   15 start() {
   16         $daemon $options
   17         return $?
   18 }
   19 stop() {
   20         pkill -x ${daemon##*/}
   21         return $?
   22 }
   23 reload() {
   24         pkill -HUP -x ${daemon##*/}
   25         return $?
   26 }
   27 status() {
   28         base=${daemon##*/}
   29         dpid=`pidof -o $$ -o $PPID -o %PPID -x ${base}`
   30         if [ "$dpid" != "" ]; then
   31            echo "${base} (pid $dpid) is running..."
   32         elif [ -s /var/run/${base}.pid ]; then
   33            echo "${base} is dead but pid file exists..."
   34         else
   35            echo "${base} is stopped."
   36         fi
   37         return
   38 }
   39 ######################################################################
   40 # See how we were called
   41 ######################################################################
   42 case "$1" in
   43        start) start      ;;
   44         stop) stop       ;;
   45       reload) reload     ;;
   46      restart) stop;start ;;
   47       status) status     ;;
   48            *) echo "Usage: $0 {start|stop|reload|restart|status}" ; exit 1
   49 esac
   50 exit $?

Generated by cgit