#!/bin/bash . /etc/rc.conf . /etc/rc.d/functions . /etc/conf.d/spampd PID=$(cat /var/run/spampd.pid) start() { stat_busy "Starting Spampd" /usr/bin/spampd $ARGS if [ $? -gt 0 ]; then stat_fail else add_daemon spampd stat_done fi } stop() { stat_busy "Stopping Spampd" kill $PID if [ $? -gt 0 ]; then stat_fail else rm_daemon postfix stat_done fi } case "$1" in start) start ;; stop) stop ;; restart) # calling 'stop' and 'start' without the $0 fails... $0 stop $0 start ;; *) echo "usage: $0 {start|stop|restart}" esac exit 0