]>
Commit | Line | Data |
---|---|---|
830cb9db | 1 | #!/bin/sh |
d584f36f AF |
2 | # |
3 | # named This shell script takes care of starting and stopping | |
4 | # named (BIND DNS server). | |
5 | # | |
6 | # chkconfig: 345 55 45 | |
7 | # description: named (BIND) is a Domain Name Server (DNS) \ | |
8 | # that is used to resolve host names to IP addresses. | |
9 | ||
10 | # Source function library. | |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
13 | # Source networking configuration. | |
14 | . /etc/sysconfig/network | |
15 | ||
16 | # Check that networking is up. | |
17 | [ "${NETWORKING}" = "no" ] && exit 0 | |
18 | ||
19 | [ -f /usr/sbin/named ] || exit 0 | |
20 | ||
21 | [ -f /etc/named.conf ] || exit 0 | |
22 | ||
830cb9db | 23 | # Try get config.. |
24 | if [ -f /etc/sysconfig/named ]; then | |
25 | . /etc/sysconfig/named | |
26 | fi | |
d584f36f AF |
27 | |
28 | # See how we were called. | |
29 | case "$1" in | |
30 | start) | |
31 | show Starting named | |
fe4bda38 | 32 | daemon named |
d584f36f AF |
33 | touch /var/lock/subsys/named |
34 | ;; | |
35 | stop) | |
36 | show Stopping named | |
37 | killproc named | |
38 | rm -f /var/lock/subsys/named | |
39 | ;; | |
40 | status) | |
41 | status named | |
42 | ;; | |
43 | restart) | |
44 | $0 stop | |
45 | $0 start | |
46 | ;; | |
47 | *) | |
48 | echo "Usage: $0 {start|stop|status|restart}" | |
49 | exit 1 | |
50 | esac | |
51 | ||
52 | exit 0 |