#!/bin/sh
# chkconfig: - 90 12
# description: ndtpd is the Network Dictionary Transfer Protocol server.
# processname: ndtpd
# config: /etc/ndtpd.conf

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

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

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/ndtpd ] || exit 0
[ -f /etc/ndtpd.conf ] || exit 0

RETVAL=0

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