wok diff bind/stuff/etc/init.d/named @ rev 1612
Add bind
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Oct 19 20:03:27 2008 +0000 (2008-10-19) |
parents | |
children | 297964ebacad |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/bind/stuff/etc/init.d/named Sun Oct 19 20:03:27 2008 +0000 1.3 @@ -0,0 +1,61 @@ 1.4 +#!/bin/sh 1.5 +# /etc/init.d/named: Start, stop and restart Named deamon on SliTaz, at boot 1.6 +# time or with the command line. 1.7 +# 1.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS 1.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. 1.10 +# 1.11 +. /etc/init.d/rc.functions 1.12 +. /etc/daemons.conf 1.13 + 1.14 +NAME=Named 1.15 +DESC="Named deamon" 1.16 +DAEMON=/usr/sbin/named 1.17 +OPTIONS=$NAMED_OPTIONS 1.18 +PIDFILE=/var/run/named.pid 1.19 +#[ -n "$OPTIONS" ] || OPTIONS="-u nobody" 1.20 +[ -f /etc/bind/rndc.key ] || rndc-confgen -r /dev/urandom -a 1.21 + 1.22 +case "$1" in 1.23 + start) 1.24 + if [ -f $PIDFILE ] ; then 1.25 + echo "$NAME already running." 1.26 + exit 1 1.27 + fi 1.28 + echo -n "Starting $DESC: $NAME... " 1.29 + $DAEMON $OPTIONS 1.30 + status 1.31 + ;; 1.32 + stop) 1.33 + if [ ! -f $PIDFILE ] ; then 1.34 + echo "$NAME is not running." 1.35 + exit 1 1.36 + fi 1.37 + echo -n "Stopping $DESC: $NAME... " 1.38 + /usr/sbin/rndc stop 1.39 + status 1.40 + ;; 1.41 + reload) 1.42 + /usr/sbin/rndc reload 1.43 + status 1.44 + ;; 1.45 + restart) 1.46 + if [ ! -f $PIDFILE ] ; then 1.47 + echo "$NAME is not running." 1.48 + exit 1 1.49 + fi 1.50 + echo -n "Restarting $DESC: $NAME... " 1.51 + /usr/sbin/rndc stop 1.52 + sleep 2 1.53 + $DAEMON $OPTIONS 1.54 + status 1.55 + ;; 1.56 + *) 1.57 + echo "" 1.58 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|reload|restart]" 1.59 + echo "" 1.60 + exit 1 1.61 + ;; 1.62 +esac 1.63 + 1.64 +exit 0