986e5fe087bf1be3e8bae2d00920b2521d2e8af7
[openwrt/svn-archive/archive.git] / net / bind / files / named.init
1 #!/bin/sh /etc/rc.common
2 START=50
3
4 config_file=/etc/bind/named.conf
5 pid_file=/var/run/named/named.pid
6
7 start() {
8 if [ -e $pid_file ]
9 then
10 echo " named already running with PID `cat $pid_file`"
11 return 1
12 fi
13 echo Starting isc-bind
14
15 /usr/sbin/named -c $config_file
16
17 if [ $? -ne 0 ]
18 then
19 echo " isc-bind failed to start"
20 fi
21 }
22
23 stop() {
24 echo "Stopping isc-bind"
25 if [ -e $pid_file ]
26 then
27 kill `cat $pid_file`
28
29 if [ $? -ne 0 ]
30 then
31 echo " PID " `cat $pid_file` not found
32 echo " Is the named server running?"
33 fi
34
35 rm -f $pid_file
36
37 else
38 echo " $pid_file not found"
39 fi
40 }