#! /bin/sh # Copyright (c) 1999 NORDWERK.DE, Germany. All rights reserved. # # Author: Michael Diekmann # # /sbin/init.d/ns2 # DBROOT=/dev/null . /etc/rc.config # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START_NAMED="yes" test "$START_NAMED" = yes || exit 0 # The echo return value for success (defined in /etc/rc.config). return=$rc_done case "$1" in start) if test -x /usr/local/bind/current/sbin/named ; then echo -n "Starting BIND Domain Name Server..." startproc /usr/local/bind/current/sbin/named -u named -c /etc/named/master.conf || return=$rc_failed echo -e "$return" fi ;; stop) echo -n "Shutting down BIND Domain Name Server..." kill -TERM `cat /etc/named/rund/named.pid` || return=$rc_failed echo -e "$return" ;; restart) echo -n "Restarting BIND Domain Name Server..." kill -HUP `cat /etc/named/rund/named.pid` || return=$rc_failed echo -e "$return" ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 esac # Inform the caller not only verbosely and set an exit status. test "$return" = "$rc_done" || exit 1 exit 0