fix ipv6 lease remaining time in dhcp leases file. Now behaves
[tomato.git] / release / src / router / radvd / redhat / radvd.init
blob6e406c53509046c3124b2e00a95dc4b40e441e83
1 #! /bin/sh
3 # $Id: radvd.init,v 1.7 2010/03/05 12:14:47 psavola Exp $
5 # chkconfig: - 54 46
6 # description: radvd is the router advertisement daemon for IPv6. It \
7 # listens to router solicitations and sends router \
8 # advertisements as described in "Neighbor Discovery for IP \
9 # Version 6 (IPv6)" (RFC 2461). With these advertisements \
10 # hosts can automatically configure their addresses and some \
11 # other parameters. They also can choose a default router \
12 # based on these advertisements.
14 # processname: radvd
15 # pidfile: /var/run/radvd.pid
16 # config: /etc/radvd.conf
17 # config: /etc/sysconfig/radvd
19 ### BEGIN INIT INFO
20 # Provides: radvd
21 # Short-Description: router advertisement daemon for IPv6
22 ### END INIT INFO
24 # Source function library.
25 . /etc/rc.d/init.d/functions
27 # Get config.
28 . /etc/sysconfig/network
30 [ -f /etc/sysconfig/radvd ] && . /etc/sysconfig/radvd
32 RETVAL=0
33 PROG="radvd"
34 LOCKFILE=/var/lock/subsys/radvd
36 # See how we were called.
37 case "$1" in
38 start)
39 if [ ! -f /etc/radvd.conf ]; then
40 echo $"Configuration file /etc/radvd.conf missing" 1>&2
41 exit 6
43 if [ `id -u` -ne 0 ]; then
44 echo $"Insufficient privilege" 1>&2
45 exit 4
47 echo -n $"Starting $PROG: "
48 daemon radvd $OPTIONS
49 RETVAL=$?
50 echo
51 if [ $RETVAL -eq 0 ]; then
52 touch $LOCKFILE
53 else
54 if [ -f $LOCKFILE ]; then
55 RETVAL=0
59 stop)
60 echo -n $"Stopping $PROG: "
61 killproc radvd
62 RETVAL=$?
63 echo
64 [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
66 status)
67 status radvd
68 RETVAL=$?
70 restart)
71 $0 stop
72 $0 start
73 RETVAL=$?
75 reload|force-reload)
76 echo -n $"Reloading $PROG: "
77 killproc radvd -HUP
78 RETVAL=$?
79 echo
81 condrestart|try-restart)
82 if [ -f $LOCKFILE ]; then
83 $0 stop
84 $0 start
85 RETVAL=$?
87 ;;
89 echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
90 exit 2
91 esac
93 exit $RETVAL