diff options
author | Matthew Thode <prometheanfire@gentoo.org> | 2016-12-22 10:11:27 -0600 |
---|---|---|
committer | Matthew Thode <prometheanfire@gentoo.org> | 2016-12-22 10:11:46 -0600 |
commit | 493cad2cd714d20609f88f968c2d34554a11655e (patch) | |
tree | be112d8846651e31c21c055410d5b8be1a397648 /net-misc/radvd/files/radvd-2.15.init | |
parent | media-libs/gegl: remove unused patches (diff) | |
download | gentoo-493cad2cd714d20609f88f968c2d34554a11655e.tar.gz gentoo-493cad2cd714d20609f88f968c2d34554a11655e.tar.bz2 gentoo-493cad2cd714d20609f88f968c2d34554a11655e.zip |
net-misc/radvd: update to use /run everywhere
Package-Manager: portage-2.3.0
Diffstat (limited to 'net-misc/radvd/files/radvd-2.15.init')
-rw-r--r-- | net-misc/radvd/files/radvd-2.15.init | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/net-misc/radvd/files/radvd-2.15.init b/net-misc/radvd/files/radvd-2.15.init new file mode 100644 index 000000000000..1603d5d0aeb2 --- /dev/null +++ b/net-misc/radvd/files/radvd-2.15.init @@ -0,0 +1,71 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +CONFIGFILE=/etc/radvd.conf +PIDFILE=/run/radvd/radvd.pid +SYSCTL_FORWARD=net.ipv6.conf.all.forwarding + +extra_started_commands="reload" + +depend() { + need net +} + +checkconfig() { + if [ ! -f "${CONFIGFILE}" ]; then + eerror "Configuration file ${CONFIGFILE} not found" + return 1 + fi + + if ! /usr/sbin/radvd -c -C "${CONFIGFILE}" ; then + eerror "Configuration file ${CONFIGFILE} failed test" + return 1 + fi + + checkpath -d -o radvd:radvd ${PIDFILE%/*} +} + +start() { + if [ "${FORWARD}" != "no" ]; then + ebegin "Enabling IPv6 forwarding" + sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null + eend $? + fi + + 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 $? + + if [ "${FORWARD}" != "no" ]; then + ebegin "Disabling IPv6 forwarding" + sysctl -w "${SYSCTL_FORWARD}=0" > /dev/null + eend $? + fi +} + +reload() { + if [ "${FORWARD}" != "no" ]; then + ebegin "Enabling IPv6 forwarding" + sysctl -w "${SYSCTL_FORWARD}=1" >/dev/null + eend $? + fi + + checkconfig || return 1 + + ebegin "Reloading IPv6 Router Advertisement Daemon" + start-stop-daemon --signal HUP \ + --exec /usr/sbin/radvd --pidfile "${PIDFILE}" + eend $? +} |