#!/bin/sh
#
# Start or stop dents
#
# Michel Onstein <promera@debian.org>
#
# chkconfig: 2345 55 45
# description: dents is a domain name service

# Source function library.
. /etc/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

DAEMON=dents

start () {
  # start daemon
  echo -n $"Starting $DAEMON: "
  daemon $DAEMON
  RETVAL=$?
  echo
  [ $RETVAL = 0 ] && touch /var/lock/subsys/$DAEMON
  return $RETVAL
}

stop () {
  # stop daemon
  echo -n $"Stopping $DAEMON: "
  killproc $DAEMON
  RETVAL=$?
  echo
  [ $RETVAL = 0 ] && rm -f /var/lock/subsys/$DAEMON
}

restart() {
	stop
	start
}

case "$1" in
	
	start)
		start
	;;
	
	stop)
		stop
	;;

	restart)
		restart
	;;
	
	condrestart)
	[ -f /var/lock/subsys/$DAEMON ] && restart || :
	;;
	
	status)
		status $DAEMON
	;;
	*) 

	echo $"Usage: $DAEMON {start|stop|restart|condrestart|status}" >&2
	exit 1
esac

exit $RETVAL

