]>
Commit | Line | Data |
---|---|---|
685307dc | 1 | #!/bin/sh |
2 | # | |
3 | # avahi-dnsconfd: Starts the Avahi dns configuration daemon | |
4 | # | |
7bf52e36 | 5 | # chkconfig: 345 35 65 |
685307dc | 6 | # |
7 | # description: avahi-dnsconfd connects to a running avahi-daemon and runs the script \ | |
8 | # /etc/avahi/dnsconf.action for each unicast DNS server that is announced \ | |
9 | # on the local LAN. This is useful for configuring unicast DNS servers in \ | |
10 | # a DHCP-like fashion with mDNS. | |
11 | # | |
12 | ||
13 | ||
14 | # Source function library | |
15 | . /etc/rc.d/init.d/functions | |
16 | ||
17 | # Get network config | |
18 | . /etc/sysconfig/network | |
19 | ||
20 | # Check that networking is up. | |
21 | if is_yes "${NETWORKING}"; then | |
22 | if [ ! -f /var/lock/subsys/network ]; then | |
23 | msg_network_down avahi-dnsconfd | |
24 | exit 1 | |
25 | fi | |
26 | else | |
27 | exit 0 | |
28 | fi | |
29 | ||
30 | ||
31 | # See how we were called. | |
32 | case "$1" in | |
33 | start) | |
34 | # Check if the service is already running? | |
35 | if [ ! -f /var/lock/subsys/avahi-dnsconfd ]; then | |
36 | msg_starting avahi-dnsconfd | |
9c548ef6 | 37 | daemon avahi-dnsconfd -D |
685307dc | 38 | RETVAL=$? |
39 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/avahi-dnsconfd | |
40 | else | |
41 | msg_already_running avahi-dnsconfd | |
42 | fi | |
43 | ;; | |
44 | stop) | |
45 | if [ -f /var/lock/subsys/avahi-dnsconfd ]; then | |
46 | # Stop daemons. | |
47 | msg_stopping avahi-dnsconfd | |
f0fbb15d | 48 | avahi-dnsconfd -k |
685307dc | 49 | rm -f /var/lock/subsys/avahi-dnsconfd |
f0fbb15d | 50 | ok |
685307dc | 51 | else |
52 | msg_not_running avahi-dnsconfd | |
53 | fi | |
54 | ;; | |
55 | restart) | |
56 | $0 stop | |
57 | $0 start | |
58 | exit $? | |
59 | ;; | |
60 | reload) | |
61 | if [ -f /var/lock/subsys/avahi-dnsconfd ]; then | |
62 | msg_reloading avahi-dnsconfd | |
f0fbb15d | 63 | avahi-dnsconfd -r |
685307dc | 64 | RETVAL=$? |
65 | else | |
66 | msg_not_running avahi-dnsconfd >&2 | |
67 | RETVAL=7 | |
68 | fi | |
69 | ;; | |
70 | force-reload) | |
685307dc | 71 | $0 reload |
685307dc | 72 | exit $? |
73 | ;; | |
74 | status) | |
75 | status avahi-dnsconfd | |
76 | RETVAL=$? | |
77 | ;; | |
78 | *) | |
79 | msg_usage "$0 {start|stop|restart|reload|force-reload|status}" | |
80 | exit 3 | |
81 | esac | |
82 | ||
83 | exit $RETVAL | |
84 | ||
85 | # This must be last line ! | |
b5da0c50 | 86 | # vi:syntax=sh:tw=78:ts=4:sw=4 |