summaryrefslogtreecommitdiffstats
path: root/initscript/freebsd/avahi-daemon.sh.in
blob: f3da39fa17cafe571f80faa805aa5f2d8034e39d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#
# $FreeBSD: /repoman/r/pcvs/ports/net/avahi/files/avahi-daemon.sh,v 1.2 2005/11/19 05:55:56 marcus Exp $
#
# PROVIDE: avahi_daemon
# REQUIRE: DAEMON dbus
# KEYWORD: FreeBSD
#
# Avahi's mDNSResponder, a Zeroconf (Bonjour) service advertisement daemon.
#

avahi_daemon_enable=${avahi_daemon_enable-"NO"}
avahi_daemon_flags=${avahi_daemon_flags-"-D"}

. /etc/rc.subr

name=avahi_daemon
rcvar=`set_rcvar`

start_cmd=avahi_daemon_start
stop_cmd=avahi_daemon_stop

avahi_daemon_bin=@sbindir@/avahi-daemon

avahi_daemon_start() {
    checkyesno avahi_daemon_enable && echo "Starting avahi-daemon." && \
    	${avahi_daemon_bin} ${avahi_daemon_flags}
}

avahi_daemon_stop() {
    checkyesno avahi_daemon_enable && echo "Stopping avahi-daemon." && \
    	${avahi_daemon_bin} -k
}

load_rc_config ${name}
run_rc_command "$1"