#!/bin/sh
#
# Start the cucipop POP3 daemon.

run_cucipop=1
cucipop_options="-Ya"

PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/cucipop
NAME=cucipop
FLAGS="defaults 50"

test -f $DAEMON || exit 0

case "$1" in

  start)
    if [ $run_cucipop = 1 ]
    then
	start-stop-daemon --start --verbose --pidfile /var/run/$NAME.pid \
	--exec $DAEMON -- $cucipop_options
    fi
    ;;

  stop)
    if [ $run_cucipop = 1 ]
    then
	start-stop-daemon --stop --verbose --pidfile /var/run/$NAME.pid \
	--exec $DAEMON
    fi
    ;;

  *)
    echo "Usage: /etc/init.d/$NAME {start|stop}"
    exit 1
    ;;

esac

exit 0
