2010-05-11 20:01:42 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# /etc/rc.d/rc.radvd
|
|
|
|
#
|
|
|
|
# Start/stop/restart the radvd daemon.
|
|
|
|
|
|
|
|
if ! [ -f /proc/net/if_inet6 ]; then
|
2014-08-24 20:45:37 +02:00
|
|
|
echo "IPv6 support not found; exiting..."
|
2010-05-11 20:01:42 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
radvd_start() {
|
|
|
|
if [ -x /usr/sbin/radvd ]; then
|
2014-08-24 20:45:37 +02:00
|
|
|
echo "Starting radvd: /usr/sbin/radvd -u daemon"
|
2010-05-11 20:01:42 +02:00
|
|
|
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
|
2013-06-12 00:46:20 +02:00
|
|
|
mkdir -p /var/run/radvd
|
|
|
|
chown daemon:daemon /var/run/radvd
|
2010-05-11 20:01:42 +02:00
|
|
|
/usr/sbin/radvd -u daemon
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
radvd_stop() {
|
2014-08-24 20:45:37 +02:00
|
|
|
/bin/kill $(cat /var/run/radvd/radvd.pid 2>/dev/null) 2>/dev/null
|
2010-05-11 20:01:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2010-05-13 00:38:08 +02:00
|
|
|
|