aboutsummaryrefslogtreecommitdiffstats
path: root/testing/unbound/unbound.initd
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2011-06-09 14:20:16 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2011-06-09 14:20:16 +0000
commit41b2fd1e4233c48d854968b309fd3fa342990fad (patch)
tree2e12400c23ddd4487d202854aca0e531eb6bf580 /testing/unbound/unbound.initd
parente05b4596e175797c77c673d90e8f43d5d060780e (diff)
downloadaports-41b2fd1e4233c48d854968b309fd3fa342990fad.tar.bz2
aports-41b2fd1e4233c48d854968b309fd3fa342990fad.tar.xz
testing/unbound: new aport
ref #683
Diffstat (limited to 'testing/unbound/unbound.initd')
-rw-r--r--testing/unbound/unbound.initd51
1 files changed, 51 insertions, 0 deletions
diff --git a/testing/unbound/unbound.initd b/testing/unbound/unbound.initd
new file mode 100644
index 0000000000..e9e902c9b9
--- /dev/null
+++ b/testing/unbound/unbound.initd
@@ -0,0 +1,51 @@
+#!/sbin/runscript
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-dns/unbound/files/unbound.initd,v 1.1 2009/11/22 16:57:33 matsuu Exp $
+
+opts="${opts} checkconfig reload"
+
+UNBOUND_BINARY=${UNBOUND_BINARY:-/usr/sbin/unbound}
+UNBOUND_CHECKCONF=${UNBOUND_CHECKCONF:-/usr/sbin/unbound-checkconf}
+UNBOUND_CONFFILE=${UNBOUND_CONFFILE:-/etc/unbound/${SVCNAME}.conf}
+
+depend() {
+ need net
+ use logger
+ provide dns
+ after auth-dns
+}
+
+checkconfig() {
+ UNBOUND_PIDFILE=$("${UNBOUND_CHECKCONF}" -o pidfile "${UNBOUND_CONFFILE}")
+ return $?
+}
+
+start() {
+ checkconfig || return $?
+ ebegin "Starting unbound"
+ start-stop-daemon --start --pidfile "${UNBOUND_PIDFILE}" \
+ --exec "${UNBOUND_BINARY}" -- -c "${UNBOUND_CONFFILE}"
+ eend $?
+}
+
+stop() {
+ checkconfig || return $?
+ ebegin "Stopping unbound"
+ start-stop-daemon --stop --pidfile "${UNBOUND_PIDFILE}"
+ eend $?
+}
+
+restart() {
+ checkconfig || return $?
+ svc_stop
+ svc_start
+}
+
+reload() {
+ checkconfig || return $?
+ ebegin "Reloading unbound"
+ start-stop-daemon --stop --pidfile "${UNBOUND_PIDFILE}" \
+ --signal HUP --oknodo
+ eend $?
+}