#! /bin/sh
#
# chkconfig: - 60 20
# description: Network dictionary server
# processname: ndtpd

# Get config.
. /etc/sysconfig/network

# Get functions
. /etc/rc.d/init.d/functions

RETVAL=0

# See how we were called.
case "$1" in
  start)
	echo -n "Starting ndtp services: "
	daemon /usr/sbin/ndtpd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ndtpd
	;;
  stop)
	echo -n "Stopping ndtp services: "
	killproc /usr/sbin/ndtpd
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ndtpd
	;;
  status)
	status /usr/sbin/ndtpd
	RETVAL=$?
	;;
  restart)
	$0 stop
	$0 start
	RETVAL=$?
	;;
  *)
	echo "Usage: $0 {start|stop|status|restart}"
	exit 1
	;;
esac

exit $RETVAL
