#!/bin/sh
# description: Domain name server daemon
#
# GNU GPL (c) Eko M. Budi 2004
#         (c) Vector Linux 2004

# Include the functions declared in the /etc/rc.d/functions file
source /etc/rc.d/functions

# path to binary
ROOT="/usr/sbin"
# name of binary to run
APP="named"
#runtime options
OPT=""
#server name & description
SERVER="BIND Domain name server"

case "$1" in
        start)
                echon "Starting $SERVER............"
                loadproc $ROOT/$APP $OPT
                ;;
	reload)
                echon "Reloading $SERVER............"
                rndc reload &> /dev/null
		evaluate_retval
                ;;      
        stop)
                echon "Stopping $SERVER............"
                rndc stop &> /dev/null
		evaluate_retval
                ;;
        restart)
                $0 stop
                /bin/sleep 1
                $0 start
                ;;
        status)
                rndc status
                ;;
        *)
                echo "Usage: $0 {start|stop|restart|status|reload}"
                exit 1
        ;;

esac

# End /etc/init.d/
