summaryrefslogtreecommitdiff
path: root/network/radvd/rc.radvd.new
diff options
context:
space:
mode:
authorSean Donner <sean.donner@sbcglobal.net>2010-05-11 20:01:42 +0200
committerRobby Workman <rworkman@slackbuilds.org>2010-05-11 20:01:42 +0200
commit2cbbb85ddb88d186881111c52c5604289770ea97 (patch)
treedcde0cb0f1e857ba50992b5091def9025ab3364e /network/radvd/rc.radvd.new
parentd4d1d6cb5828211146afb541ab33eb114f893326 (diff)
downloadslackbuilds-2cbbb85ddb88d186881111c52c5604289770ea97.tar.gz
network/radvd: Added to 12.0 repository
Diffstat (limited to 'network/radvd/rc.radvd.new')
-rw-r--r--network/radvd/rc.radvd.new44
1 files changed, 44 insertions, 0 deletions
diff --git a/network/radvd/rc.radvd.new b/network/radvd/rc.radvd.new
new file mode 100644
index 0000000000..617a82b543
--- /dev/null
+++ b/network/radvd/rc.radvd.new
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# /etc/rc.d/rc.radvd
+#
+# Start/stop/restart the radvd daemon.
+#
+
+if ! [ -f /proc/net/if_inet6 ]; then
+ echo "IPv6 support not found; exiting..."
+ exit 1
+fi
+
+radvd_start() {
+ if [ -x /usr/sbin/radvd ]; then
+ echo "Starting radvd..."
+ echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
+ /usr/sbin/radvd -u daemon
+ fi
+}
+
+radvd_stop() {
+ /bin/kill $(cat /var/run/radvd/radvd.pid)
+ rm -f /var/run/radvd/radvd.pid
+}
+
+radvd_restart() {
+ radvd_stop
+ sleep 2
+ radvd_start
+}
+
+case "$1" in
+'start')
+ radvd_start
+ ;;
+'stop')
+ radvd_stop
+ ;;
+'restart')
+ radvd_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac