#!/bin/sh
#
# named         This shell script takes care of starting and stopping
#               named (DNS server).
#		Hacked for bind-chroot and ndc by jam.
# chkconfig: 345 55 10
# description: name server daemon
# processname: named

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

# Name of our chroot directory.  All should work well when empty.
CHROOTDIR=/home/named

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

[ -f /usr/sbin/ndc ] || exit 0

[ -f /usr/sbin/named ] || exit 0

[ -f ${CHROOTDIR}/etc/named.conf ] || exit 0

[ -n "${CHROOTDIR}" ] && { [ -f /usr/sbin/holelogd.named ] || exit 0 }

# See how we were called.
case "$1" in
  start|stop|restart|status)
    /usr/sbin/ndc $1
    exit 0
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
esac
