#!/bin/bash # # bogofilter-milter.pl This shell script takes care of starting and stopping # bogofilter-milter.pl. # # chkconfig: 2345 79 31 # description: bogofilter-milter.pl integrates bogofilter into sendmail. # processname: bogofilter-milter.pl # pidfile: /var/run/bogofilter-milter.pid # This script is known to work on Fedora systems and will probably # work on other Fedora-like systems. To use it, save it as # /etc/rc.d/init.d/bogofilter-milter, make sure it's executable, and # run "chkconfig bogofilter-milter on". # If you change where bogofilter-milter.pl is saved, edit the "path" # line below. If you change the $pid_file setting in # bogofilter-milter.pl, edit the "pidfile" setting above. If you save # the script as something other than bogofilter-milter.pl, edit the # "description" and "processname" settings above. # This script is by Jonathan Kamens . . /etc/rc.d/init.d/functions RETVAL=0 path=/etc/mail/bogofilter-milter.pl prog=bogofilter-milter start() { echo -n $"Starting $prog: " daemon --check $prog $path --daemon RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog return $RETVAL } stop() { echo -n $"Shutting down $prog: " killproc $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog return $RETVAL } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) stop start RETVAL=$? ;; condrestart) if [ -f /var/lock/subsys/$prog ]; then stop start RETVAL=$? fi ;; status) status $prog RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" exit 1 esac exit $RETVAL