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

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

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

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

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

exit 0
