#!/bin/sh
#
# ndtpd         This shell script takes care of starting and stopping
#               ndtpd (NDTP daemon)
#
# chkconfig: 345 85 15
# description: NDTPD is a server for accessing CD-ROM books
#		with NDTP (Network Dictionary Transfer Protocol) on TCP.  
# processname: ndtpd
# pidfile:  /var/ndtpd/ndtpd.pid 
# config: /etc/ndtpd.conf

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

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

# Check that networking is up.
[ -f /usr/sbin/ndtpd ] || exit 0
[ -f /etc/ndtpd//ndtpd.conf ] || exit 0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting ndtpd: "
        daemon /usr/sbin/ndtpd
        echo
        touch /var/lock/subsys/ndtpd
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down ndtpd: "
	killproc ndtpd
        echo
        rm -f /var/lock/subsys/ndtpd
        ;;
  status)
	status lpd
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
        echo "Usage: ndtpd {start|stop|restart|status}"
        exit 1
esac

exit 0
