From: frank Date: Wed, 30 May 2012 16:40:44 +0000 (+0200) Subject: saving uncommitted changes in /etc prior to emerge run X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=9de9dd7a6db2663a35e4d1f891cf8812f4101c18;p=config%2Fbruni%2Fetc.git saving uncommitted changes in /etc prior to emerge run --- diff --git a/init.d/._cfg0000_radvd b/init.d/._cfg0000_radvd new file mode 100755 index 00000000..ce8c8254 --- /dev/null +++ b/init.d/._cfg0000_radvd @@ -0,0 +1,66 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/radvd/files/radvd-1.8.5.init,v 1.1 2012/05/29 13:38:53 xmw 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 +} + +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 --signal HUP \ + --exec /usr/sbin/radvd --pidfile "${PIDFILE}" + eend $? +}