#!/sbin/sh ############################################# # SLOW.INIT # A script that starts, stops, and # restarts the milter. # # This script may be installed in /etc/init.d # under Solaris and the like. Or used as # an /etc/rc-style startup script. ############################################# export MILTER MILTERDIR MILTERARGS MILTERSLEEP MILTERSEMAPHORE MILTERRUNAS MILTERWHO=slow MILTER=slowmilt MILTERDIR=/etc/mail/milter/slow MILTERARGS= MILTERSLEEP=5 MILTERRUN=slow.run MILTERSEMAPHORE=slow.semaphore # define if your run this script as root #MILTERRUNAS="su ${MILTERWHO} -c" MILTERRUNAS= case "$1" in 'start') if [ -f ${MILTERDIR}/${MILTER} -a -d ${MILTERDIR} ]; then ${MILTERDIR}/${MILTER} -f touch ${MILTERDIR}/${MILTERSEMAPHORE} exec ${MILTERDIR}/${MILTERRUN} & echo ${MILTER} started else echo Error: ${MILTER} or ${MILTERDIR} missing. fi ;; 'stop') rm ${MILTERDIR}/${MILTERSEMAPHORE} /usr/bin/pkill -x -u ${MILTERWHO} ${MILTER} echo ${MILTER} stopped ;; 'restart') $0 stop sleep $0 start ;; *) echo "Usage: $0 { start | stop | restart }" exit 1 ;; esac exit 0