#!/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"