#! /bin/sh
#

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/ids-pop3d
MAX_CHILDREN=5

test -f $DAEMON || exit 0
grep "^pop-3" /etc/inetd.conf > /dev/null 2>&1 && exit 0

case "$1" in
  start)
    start-stop-daemon --start --verbose --exec $DAEMON -- -d $MAX_CHILDREN
    ;;
  stop)
    start-stop-daemon --stop --verbose --exec $DAEMON
    ;;
  restart|force-reload)
  	start-stop-daemon --stop --verbose --exec $DAEMON
	start-stop-daemon --start --verbose --exec $DAEMON -- -d $MAX_CHILDREN
	;;
  *)
    echo "Usage: /etc/init.d/ids-pop3d {start|stop|restart|force-reload}"
    exit 1
    ;;
esac

exit 0
