slackbuilds_ponce/network/radvd/rc.radvd.new
Robby Workman b4a64411ee network/radvd: Updated for version 1.15.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Signed-off-by: Leigh Wedding <<leigh8904@gmail.com>
2014-08-30 14:21:28 +07:00

45 lines
736 B
Bash

#!/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: /usr/sbin/radvd -u daemon"
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
mkdir -p /var/run/radvd
chown daemon:daemon /var/run/radvd
/usr/sbin/radvd -u daemon
fi
}
radvd_stop() {
/bin/kill $(cat /var/run/radvd/radvd.pid 2>/dev/null) 2>/dev/null
}
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