]> git.pld-linux.org Git - packages/avahi.git/blob - avahi-dnsconfd
- 34+66=100
[packages/avahi.git] / avahi-dnsconfd
1 #!/bin/sh
2 #
3 # avahi-dnsconfd:       Starts the Avahi dns configuration daemon
4 #
5 # chkconfig:            345 34 66
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
37                 daemon avahi-dnsconfd -D
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
48                 avahi-dnsconfd -k
49                 rm -f /var/lock/subsys/avahi-dnsconfd
50                 ok
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
63                 avahi-dnsconfd -r
64                 RETVAL=$?
65         else
66                 msg_not_running avahi-dnsconfd >&2
67                 RETVAL=7
68         fi
69         ;;
70   force-reload)
71         $0 reload
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 !
86 # vi:syntax=sh:tw=78:ts=4:sw=4
This page took 0.158553 seconds and 3 git commands to generate.