summaryrefslogtreecommitdiff
path: root/dns/radns/files
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2011-09-28 09:48:16 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2011-09-28 09:48:16 +0000
commit0f3eb33db7f8390f466b429fcaf5091ab94e1f80 (patch)
treec2a09d07d3b50bca45571a6368ed523fc3571ee0 /dns/radns/files
parentFix double BUILD_DEPENDS macro (diff)
Router Advertisement DNS (radns)
radns is an IPv6 DNS server address autoconfiguration client. It listens for IPv6 Router Advertisements with the Recursive DNS Server (RDNSS) and the DNS Search List (DNSSL) options and stores the search list and address(es) in a file in the same syntax as resolv.conf(5). WWW: http://hack.org/mc/hacks/radns/ PR: ports/159626 Submitted by: Michael Cardell Widerkrantz <mc@hack.org>
Notes
Notes: svn path=/head/; revision=282562
Diffstat (limited to 'dns/radns/files')
-rw-r--r--dns/radns/files/pkg-message.in13
-rw-r--r--dns/radns/files/radns.in70
2 files changed, 83 insertions, 0 deletions
diff --git a/dns/radns/files/pkg-message.in b/dns/radns/files/pkg-message.in
new file mode 100644
index 000000000000..8e6cf44d5520
--- /dev/null
+++ b/dns/radns/files/pkg-message.in
@@ -0,0 +1,13 @@
+****************************************************
+
+To enable radns, edit /etc/rc.conf and add:
+
+ radns_enable="YES"
+
+radns won't touch your system's /etc/resolv.conf. It will write to its
+own file %%PREFIX%%/etc/radns/radns-resolv.conf.
+
+To make sure the system's /etc/resolv.conf file is created from all
+sources, read %%PREFIX%%/share/doc/radns/README.FreeBSD.
+
+****************************************************
diff --git a/dns/radns/files/radns.in b/dns/radns/files/radns.in
new file mode 100644
index 000000000000..81d31496c68f
--- /dev/null
+++ b/dns/radns/files/radns.in
@@ -0,0 +1,70 @@
+#! /bin/sh
+#
+# PROVIDE: radns
+# REQUIRE: DAEMON LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable radns:
+#
+# radns_enable (bool): Set it to "YES" to enable radns
+# Default is "NO".
+# radns_resolv (path): Full path to radns' own resolv.conf
+# radns_pidfile (path): Full path to pid file.
+# radns_script (path): Full path to script file or empty string if no script.
+# radns_username (user): Username the daemon will run as.
+#
+
+. /etc/rc.subr
+
+name=radns
+rcvar=`set_rcvar`
+radns_dir="%%PREFIX%%/etc/radns"
+
+load_rc_config $name
+
+# Default values
+: ${radns_enable="NO"}
+: ${radns_pidfile="/var/run/${name}.pid"}
+: ${radns_resolv="${radns_dir}/radns-resolv.conf"}
+: ${radns_script=""}
+: ${radns_username="radns"}
+
+command="%%PREFIX%%/bin/${name}"
+
+start_precmd=start_precmd
+stop_postcmd=stop_postcmd
+
+start_precmd()
+{
+ [ -d ${radns_dir} ] || mkdir ${radns_dir}
+ chown ${radns_username} ${radns_dir}
+}
+
+stop_postcmd()
+{
+ rm -f ${radns_resolv}
+ rm -f ${radns_pidfile}
+}
+
+# if script:
+if [ x${radns_script} != "x" ]
+then
+ command_args="-f ${radns_resolv} -s ${radns_script} -u ${radns_username} \
+ -p ${radns_pidfile}"
+else
+ command_args="-f ${radns_resolv} -u ${radns_username} -p ${radns_pidfile}"
+fi
+
+reload_precmd()
+{
+ echo "Stopping ${name} and start gracefully."
+}
+
+reload_postcmd()
+{
+ rm -f ${radns_pidfile}
+ run_rc_command start
+}
+
+# actually execute the program
+run_rc_command "$1"