summaryrefslogtreecommitdiff
path: root/aports/radvd/radvd.initd
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2023-09-24 10:02:17 +0200
committerPÁLI Gábor János <pali.gabor@gmail.com>2023-09-26 11:53:45 +0200
commitcd4ad7988e34326f1cc9552c71e522c8d31b1cc3 (patch)
treef82dc373ce18f3a94163371af2d99399ad4ce978 /aports/radvd/radvd.initd
parente7633ba62583438640cdaa216c0f8f00bc37ad91 (diff)
downloadfreebsd-wifibox-alpine-cd4ad7988e34326f1cc9552c71e522c8d31b1cc3.zip
radvd: import
Diffstat (limited to 'aports/radvd/radvd.initd')
-rw-r--r--aports/radvd/radvd.initd49
1 files changed, 49 insertions, 0 deletions
diff --git a/aports/radvd/radvd.initd b/aports/radvd/radvd.initd
new file mode 100644
index 0000000..108e483
--- /dev/null
+++ b/aports/radvd/radvd.initd
@@ -0,0 +1,49 @@
+#!/sbin/openrc-run
+# 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=/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
+
+ 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 $?
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading IPv6 Router Advertisement Daemon"
+ start-stop-daemon --stop --signal HUP --oknodo \
+ --exec /usr/sbin/radvd --pidfile "${PIDFILE}"
+ eend $?
+}