summaryrefslogtreecommitdiffstats
path: root/main/radvd/radvd.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-10-22 06:29:34 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-10-22 06:30:49 +0000
commit0a5e89eab97504fe901bdae1c6bb87b360d59aff (patch)
treeb28541b0f1763d6945b10055eaf94b599ad40034 /main/radvd/radvd.initd
parentea1d2187ea42928c1200d87ff6856e0107a70c99 (diff)
downloadaports-0a5e89eab97504fe901bdae1c6bb87b360d59aff.tar.bz2
aports-0a5e89eab97504fe901bdae1c6bb87b360d59aff.tar.xz
main/radvd: moved from testing
Diffstat (limited to 'main/radvd/radvd.initd')
-rw-r--r--main/radvd/radvd.initd67
1 files changed, 67 insertions, 0 deletions
diff --git a/main/radvd/radvd.initd b/main/radvd/radvd.initd
new file mode 100644
index 000000000..8510ae1cc
--- /dev/null
+++ b/main/radvd/radvd.initd
@@ -0,0 +1,67 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/files/radvd.init,v 1.6 2011/12/04 10:14:13 swegener Exp $
+
+CONFIGFILE=/etc/radvd.conf
+PIDFILE=/var/run/radvd/radvd.pid
+SYSCTL_FORWARD=net.ipv6.conf.all.forwarding
+
+extra_started_commands="reload"
+
+depend() {
+ need net
+ after firewall
+}
+
+checkconfig() {
+ if [ ! -f "${CONFIGFILE}" ]; then
+ eerror "Configuration file ${CONFIGFILE} not found"
+ return 1
+ fi
+
+ checkpath -d -o radvd:radvd ${PIDFILE%/*}
+}
+
+start() {
+ checkconfig || return 1
+
+ if [ "${FORWARD}" != "no" ]; then
+ ebegin "Enabling IPv6 forwarding"
+ sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null
+ eend $?
+ fi
+
+ ebegin "Starting IPv6 Router Advertisement Daemon"
+ start-stop-daemon --start --exec /usr/sbin/radvd \
+ --pidfile "${PIDFILE}" \
+ -- -C "${CONFIGFILE}" -p "${PIDFILE}" -u radvd ${OPTIONS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping IPv6 Router Advertisement Daemon"
+ start-stop-daemon --stop --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
+ eend $?
+
+ if [ "${FORWARD}" != "no" ]; then
+ ebegin "Disabling IPv6 forwarding"
+ sysctl -w "${SYSCTL_FORWARD}=0" > /dev/null
+ eend $?
+ fi
+}
+
+reload() {
+ checkconfig || return 1
+
+ if [ "${FORWARD}" != "no" ]; then
+ ebegin "Enabling IPv6 forwarding"
+ sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null
+ eend $?
+ fi
+
+ ebegin "Reloading IPv6 Router Advertisement Daemon"
+ start-stop-daemon --stop --signal HUP --oknodo \
+ --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
+ eend $?
+}