mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-10-28 06:52:00 +01:00
68 lines
1.5 KiB
Plaintext
68 lines
1.5 KiB
Plaintext
#!/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.4 2011/03/05 10:43:29 vapier Exp $
|
|
|
|
CONFIGFILE=/etc/radvd.conf
|
|
PIDFILE=/var/run/radvd/radvd.pid
|
|
SYSCTL_FORWARD=net.ipv6.conf.all.forwarding
|
|
|
|
opts="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 $?
|
|
}
|