"Fossies" - the Fresh Open Source Software Archive

Member "spammilt-0.5.0-rc7/RedHat/spammiltd.init" (30 Dec 2003, 1354 Bytes) of package /linux/privat/old/spammilt-0.5.0-rc7.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 #
    3 # spammiltd         This shell script takes care of starting and stopping
    4 #           spammiltd
    5 #
    6 # chkconfig: 2345 79 31
    7 # description: spammiltd provides spam filtering through the milter API of 
    8 #              sendmail.
    9 
   10 # Source function library.
   11 . /etc/rc.d/init.d/functions
   12 
   13 # Source networking configuration.
   14 . /etc/sysconfig/network
   15 . /etc/sysconfig/spammiltd
   16 
   17 # Check that networking is up.
   18 [ ${NETWORKING} = "no" ] && exit 0
   19 
   20 [ -f /usr/sbin/spammiltd ] || exit 0
   21 [ -f /etc/mail/spam/black.list ] || exit 0
   22 [ -f /etc/mail/spam/white.list ] || exit 0
   23 [ -f /etc/mail/spam/dnsbl-ignore.list ] || exit 0
   24 
   25 RETVAL=0
   26 prog="spammiltd"
   27 
   28 start() {
   29     # Start daemons.
   30     echo -n $"Starting $prog: "
   31     daemon /usr/sbin/spammiltd ${ARGS}
   32     RETVAL=$?
   33     echo
   34     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/spammiltd
   35     return $RETVAL
   36 }
   37 
   38 stop() {
   39     # Stop daemons.
   40     echo -n $"Shutting down $prog: "
   41     killproc spammiltd
   42     RETVAL=$?
   43     echo
   44     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/spammiltd
   45     return $RETVAL
   46 }
   47 
   48 # See how we were called.
   49 case "$1" in
   50   start)
   51     start
   52     ;;
   53   stop)
   54     stop
   55     ;;
   56   restart|reload)
   57     stop
   58     sleep 2
   59     start
   60     RETVAL=$?
   61     ;;
   62   status)
   63     status $prog
   64     RETVAL=$?
   65     ;;
   66   reread)
   67     killall -USR1 $prog
   68     RETVAL=$?
   69     ;;
   70   stats)
   71     killall -USR2 $prog
   72     RETVAL=$?
   73     ;;
   74   *)
   75     echo $"Usage: $0 {start|stop|restart|status|reread|stats}"
   76     exit 1
   77 esac
   78 
   79 exit $RETVAL
   80