#! /bin/sh
# simple script to start and stop smail as daemon

DAEMON=/usr/sbin/smail
FLAGS="-bd -q10m"



test -f $DAEMON || exit 0

case "$1" in
  start)
    echo -n "Starting smail as daemon..."
    if start-stop-daemon --start --quiet --exec $DAEMON -- $FLAGS
    then
	echo "done."
    else
        echo "failed."
    fi
    ;;
  stop)
    echo -n "Stopping smail daemon..."
    if start-stop-daemon --stop --quiet --exec $DAEMON
    then
	echo "done."
    else
	echo "failed."
    fi
    ;;
  *)
    echo "Usage: /etc/init.d/smail {start|stop}"
    exit 1
esac

exit 0
