1#!/bin/sh 2# 3# $FreeBSD: /repoman/r/pcvs/ports/net/avahi/files/avahi-dnsconfd.sh,v 1.4 2005/11/19 06:36:09 ahze Exp $ 4# 5# PROVIDE: avahi_dnsconfd 6# REQUIRE: DAEMON dbus avahi_daemon 7# KEYWORD: FreeBSD 8# 9# avahi-dnsconfd connects to a running avahi-daemon and runs the script 10# @sysconfdir@/avahi/avahi-dnsconfd.action for each unicast DNS server that 11# is announced on the local LAN. This is useful for configuring unicast 12# DNS servers in a DHCP-like fashion with mDNS. 13# 14 15avahi_dnsconfd_enable=${avahi_dnsconfd_enable-"NO"} 16avahi_dnsconfd_flags=${avahi_dnsconfd_flags-"-D"} 17 18. /etc/rc.subr 19 20name=avahi_dnsconfd 21rcvar=`set_rcvar` 22 23start_cmd=avahi_dnsconfd_start 24stop_cmd=avahi_dnsconfd_stop 25 26avahi_dnsconfd_bin=@sbindir@/avahi-dnsconfd 27 28avahi_dnsconfd_start() { 29 checkyesno avahi_dnsconfd_enable && echo "Starting avahi-dnsconfd." && \ 30 ${avahi_dnsconfd_bin} ${avahi_dnsconfd_flags} 31} 32 33avahi_dnsconfd_stop() { 34 checkyesno avahi_dnsconfd_enable && echo "Stopping avahi-dnsconfd." && \ 35 ${avahi_dnsconfd_bin} -k 36} 37 38load_rc_config ${name} 39run_rc_command "$1" 40