summaryrefslogtreecommitdiffstats
path: root/initscript/freebsd/avahi-dnsconfd.sh.in
blob: ed01f06067f25af920c2e3d96d7afc4557c0c1dd (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
37
38
39
#!/bin/sh
#
# $FreeBSD: /repoman/r/pcvs/ports/net/avahi/files/avahi-dnsconfd.sh,v 1.4 2005/11/19 06:36:09 ahze Exp $
#
# PROVIDE: avahi_dnsconfd
# REQUIRE: DAEMON dbus avahi_daemon
# KEYWORD: FreeBSD
#
# avahi-dnsconfd connects to a running avahi-daemon and runs  the script
# @sysconfdir@/avahi/dnsconf.action for each unicast DNS server that
# is announced on the local LAN. This is useful for configuring unicast
# DNS servers in a DHCP-like fashion with mDNS.
#

avahi_dnsconfd_enable=${avahi_dnsconfd_enable-"NO"}
avahi_dnsconfd_flags=${avahi_dnsconfd_flags-"-D"}

. /etc/rc.subr

name=avahi_dnsconfd
rcvar=`set_rcvar`

start_cmd=avahi_dnsconfd_start
stop_cmd=avahi_dnsconfd_stop

avahi_dnsconfd_bin=@sbindir@/avahi-dnsconfd

avahi_dnsconfd_start() {
    checkyesno avahi_dnsconfd_enable && echo "Starting avahi-dnsconfd." && \
    	${avahi_dnsconfd_bin} ${avahi_dnsconfd_flags}
}

avahi_dnsconfd_stop() {
    checkyesno avahi_dnsconfd_enable && echo "Stopping avahi-dnsconfd." && \
    	${avahi_dnsconfd_bin} -k
}

load_rc_config ${name}
run_rc_command "$1"