#!/bin/sh
# 
# chkconfig: 345 98 02
# description: Dracd mail monitor
#
# Description: Starts and stops the dracd monitor
#              used to provide relaying authentication capabilities.
#
  
# Source function library
. /etc/rc.d/init.d/functions

BASE=rpc.dracd

# Check that $BASE exists.
[ -f /usr/sbin/$BASE ] || exit 0
[ -f /usr/sbin/rc.dracd ] || exit 0
          
RETVAL=0
# See how we were called.
case "$1" in
  start)
        echo -n "Starting dracd service: "
	daemon /usr/sbin/rc.dracd
	RETVAL=$?
        echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$BASE
        ;;
  stop)
        echo -n "Shutting down dracd service: "
        killproc $BASE
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$BASE
        ;;
  restart|reload)
        $0 stop
        $0 start
	RETVAL=$?
        ;;
  status)
	status $BASE
	RETVAL=$?
	;;
  *)
        echo "Usage: dracd {start|stop|restart|reload|status}"
        exit 1
esac
  
exit $RETVAL
