Scripts to start and stop

Adam Lang aalang at rutgersinsurance.com
Fri May 25 15:40:37 UTC 2001


I did this in the init.d directory and it works, but I would like opinion if
it is the correct way to do it

#!/bin/bash
#
# named        Starts /usr/local/sbin/named -u named
#
# description: Starts the BIND server and other options using named and rndc

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

start() {
        echo -n $"Starting named - BIND: "
        /usr/local/sbin/named -u named
}
stop() {
        echo -n $"Shutting down named - BIND: "
        /usr/local/sbin/rndc stop
}
restart() {
        stop
        start
}
reload() {
        /usr/local/sbin/rndc reload
}
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  reload)
        reload
        ;;
  *)
        echo $"Usage: $0 {start|stop|restart|reload}"
        exit 1
esac

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com



More information about the bind-users mailing list