1#! /bin/sh
2### BEGIN INIT INFO
3# Provides:          avahi
4# Required-Start:    $network $remote_fs dbus
5# Required-Stop:     $network $remote_fs dbus
6# Default-Start:     3 5
7# Default-Stop:
8# Short-Description: ZeroConf daemon
9# Description:       Avahi, a ZeroConf daemon for mDNS and service registration
10### END INIT INFO
11
12AVAHI_BIN=@sbindir@/avahi-daemon
13test -x $AVAHI_BIN || exit 5
14
15. /etc/rc.status
16rc_reset
17
18case "$1" in
19	start)
20		echo -n "Starting Avahi daemon "
21		$AVAHI_BIN -D
22		rc_status -v
23		;;
24	stop)
25		echo -n "Shutting down Avahi daemon "
26		$AVAHI_BIN -k 2>/dev/null || /bin/true
27		rc_status -v
28		;;
29	try-restart|condrestart)
30		if test "$1" = "condrestart"; then
31			echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
32		fi
33		$0 status
34		if test $? = 0; then
35			$0 restart
36		else
37			rc_reset
38		fi
39		rc_status
40		;;
41	restart)
42		$0 stop
43		$0 start
44		rc_status
45		;;
46	force-reload|reload)
47		echo -n "Reloading Avahi daemon "
48		$AVAHI_BIN -r
49		rc_status -v
50		;;
51	status)
52		echo -n "Checking for Avahi daemon: "
53		$AVAHI_BIN -c || _rc_status=3
54		rc_status -v
55		;;
56	*)
57		echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
58		exit 1
59		;;
60esac
61