]> git.meshlink.io Git - catta/blob - initscript/fedora/avahi-dnsconfd.in
Add init script support for fedora from Alexander Larsson
[catta] / initscript / fedora / avahi-dnsconfd.in
1 #! /bin/sh
2 #
3 # avahi-daemon:       Starts the Avahi dns configuration daemon
4 #
5 # chkconfig: - 34 66
6 # description: avahi-dnsconfd connects to a running avahi-daemon and runs  the  script
7 #       /etc/avahi/dnsconf.action for each unicast DNS server that is announced
8 #       on the local LAN. This is useful for configuring unicast DNS servers in
9 #       a DHCP-like fashion with mDNS.
10 # processname: avahi-dnsconfd
11 # config: 
12
13 OTHER_AVAHI_OPTS=""
14
15 # Source function library.
16 . /etc/init.d/functions
17
18 . /etc/sysconfig/network
19
20 # Check that networking is configured.
21 [ ${NETWORKING} = "no" ] && exit 0
22
23 AVAHI_BIN=@sbindir@/avahi-dnsconfd
24 test -x $AVAHI_BIN || exit 5
25
26 start() {
27         echo -n $"Starting Avahi DNS daemon... "
28         $AVAHI_BIN -D
29         RETVAL=$?
30         [ $RETVAL = 0 ] && success $"$base startup" || failure $"$base startup"
31         echo
32         return $RETVAL
33 }
34
35 stop() {
36         echo -n "Shutting down Avahi DNS daemon: "
37         $AVAHI_BIN -k
38         RETVAL=$?
39         echo
40         return $RETVAL
41 }
42
43 reload() {
44         echo -n "Reloading Avahi DNS daemon... "
45         $AVAHI_BIN -r
46         RETVAL=$?
47         [ $RETVAL = 0 ] && success $"$base startup" || failure $"$base startup"
48         echo
49         return $RETVAL
50 }
51
52
53 restart() {
54         stop
55         start
56 }
57
58 RETVAL=0
59
60 # See how we were called.
61 case "$1" in
62   start)
63         start
64         ;;
65   stop)
66         stop
67         ;;
68   status)
69         $AVAHI_BIN -c
70         [ $? = 0 ] && echo "Avahi DNS daemon is running" || echo "Avahi DNS daemon is not running"
71         ;;
72   restart)
73         restart
74         ;;
75   reload)
76         reload 
77         ;;
78   condrestart)
79         $AVAHI_BIN -c
80         [ $? = 0 ] && restart || :
81         ;;
82   *)
83         echo $"Usage: $0 {start|stop|status|restart|condrestart}"
84         exit 1
85 esac
86
87 exit $?