radvd/radvd.init
2008-06-23 14:41:25 +00:00

84 lines
1.7 KiB
Bash

#! /bin/sh
#
# $Id: radvd.init,v 1.1 2001/04/11 15:58:30 psavola Exp $
#
# chkconfig: - 54 46
# description: radvd is the router advertisement daemon for IPv6. It \
# listens to router solicitations and sends router \
# advertisements as described in "Neighbor Discovery for IP \
# Version 6 (IPv6)" (RFC 2461). With these advertisements \
# hosts can automatically configure their addresses and some \
# other parameters. They also can choose a default router \
# based on these advertisements.
#
# processname: radvd
# pidfile: /var/run/radvd.pid
# config: /etc/radvd.conf
# config: /etc/sysconfig/radvd
# Source function library.
. /etc/rc.d/init.d/functions
# Get config.
. /etc/sysconfig/network
# Check that networking is up.
if [ ! "${NETWORKING_IPV6}" = "yes" ]; then
echo "Networking IPv6 is disabled" 1>&2
exit 1
fi
if [ ! -f /etc/radvd.conf ]; then
echo "Configuration file /etc/radvd.conf missing" 1>&2
exit 6
fi
[ -f /etc/sysconfig/radvd ] && . /etc/sysconfig/radvd
if [ ! -x /usr/sbin/radvd ]; then
echo "Insufficient privilege" 1>&2
exit 4
fi
RETVAL=0
prog="radvd"
# See how we were called.
case "$1" in
start)
echo -n $"Starting $prog: "
daemon radvd $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/radvd
;;
stop)
echo -n $"Stopping $prog: "
killproc radvd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/radvd
;;
status)
status radvd
RETVAL=$?
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/radvd ]; then
$0 stop
$0 start
RETVAL=$?
fi
;;
*)
echo $"Usage: radvd {start|stop|status|restart|reload|condrestart}"
exit 1
esac
exit $RETVAL