summaryrefslogtreecommitdiffstats
path: root/initscript/freebsd
diff options
context:
space:
mode:
Diffstat (limited to 'initscript/freebsd')
-rw-r--r--initscript/freebsd/Makefile.am43
-rw-r--r--initscript/freebsd/avahi-daemon.sh.in36
-rw-r--r--initscript/freebsd/avahi-dnsconfd.sh.in39
3 files changed, 118 insertions, 0 deletions
diff --git a/initscript/freebsd/Makefile.am b/initscript/freebsd/Makefile.am
new file mode 100644
index 0000000..0ee75d5
--- /dev/null
+++ b/initscript/freebsd/Makefile.am
@@ -0,0 +1,43 @@
+# $Id$
+
+# This file is part of avahi.
+#
+# avahi is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# avahi is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+# License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with avahi; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+# USA.
+
+initddir = $(sysconfdir)/rc.d
+
+EXTRA_DIST = \
+ avahi-daemon.sh.in \
+ avahi-dnsconfd.sh.in
+
+initd_SCRIPTS = \
+ avahi-daemon.sh \
+ avahi-dnsconfd.sh
+
+CLEANFILES = \
+ avahi-daemon.sh \
+ avahi-dnsconfd.sh
+
+avahi-daemon.sh: avahi-daemon.sh.in
+ sed -e 's,@sbindir\@,$(sbindir),g' $< > $@
+ chmod +x $@
+
+avahi-dnsconfd.sh: avahi-dnsconfd.sh.in
+ sed \
+ -e 's,@sbindir\@,$(sbindir),g' \
+ -e 's,@sysconfdir\@,$(sysconfdir),g' \
+ $< > $@
+ chmod +x $@
diff --git a/initscript/freebsd/avahi-daemon.sh.in b/initscript/freebsd/avahi-daemon.sh.in
new file mode 100644
index 0000000..f3da39f
--- /dev/null
+++ b/initscript/freebsd/avahi-daemon.sh.in
@@ -0,0 +1,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"
diff --git a/initscript/freebsd/avahi-dnsconfd.sh.in b/initscript/freebsd/avahi-dnsconfd.sh.in
new file mode 100644
index 0000000..ed01f06
--- /dev/null
+++ b/initscript/freebsd/avahi-dnsconfd.sh.in
@@ -0,0 +1,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"