Home | History | Annotate | Download | only in freebsd
      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 
     15 avahi_dnsconfd_enable=${avahi_dnsconfd_enable-"NO"}
     16 avahi_dnsconfd_flags=${avahi_dnsconfd_flags-"-D"}
     17 
     18 . /etc/rc.subr
     19 
     20 name=avahi_dnsconfd
     21 rcvar=`set_rcvar`
     22 
     23 start_cmd=avahi_dnsconfd_start
     24 stop_cmd=avahi_dnsconfd_stop
     25 
     26 avahi_dnsconfd_bin=@sbindir@/avahi-dnsconfd
     27 
     28 avahi_dnsconfd_start() {
     29     checkyesno avahi_dnsconfd_enable && echo "Starting avahi-dnsconfd." && \
     30     	${avahi_dnsconfd_bin} ${avahi_dnsconfd_flags}
     31 }
     32 
     33 avahi_dnsconfd_stop() {
     34     checkyesno avahi_dnsconfd_enable && echo "Stopping avahi-dnsconfd." && \
     35     	${avahi_dnsconfd_bin} -k
     36 }
     37 
     38 load_rc_config ${name}
     39 run_rc_command "$1"
     40