Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#! /bin/sh
2
#
3
# $Id: radvd.init,v 1.7 2010/03/05 12:14:47 psavola Exp $
4
#
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.
13
#
14
# processname: radvd
15
# pidfile: /var/run/radvd/radvd.pid
16
# config: /etc/radvd.conf
17
# config: /etc/sysconfig/radvd
18
 
19
### BEGIN INIT INFO
20
# Provides: radvd
21
# Short-Description: router advertisement daemon for IPv6
22
### END INIT INFO
23
 
24
# Source function library.
25
. /etc/rc.d/init.d/functions
26
 
27
# Get config.
28
. /etc/sysconfig/network
29
 
30
[ -f /etc/sysconfig/radvd ] && . /etc/sysconfig/radvd
31
 
32
RETVAL=0
33
PROG="radvd"
34
LOCKFILE=/var/lock/subsys/radvd
35
PIDFILE=/var/run/radvd/radvd.pid
36
 
37
# See how we were called.
38
case "$1" in
39
  start)
40
	if [ ! -f /etc/radvd.conf ]; then
41
		echo $"Configuration file /etc/radvd.conf missing" 1>&2
42
		exit 6
43
	fi
44
	if [ `id -u` -ne 0 ]; then
45
		echo $"Insufficient privilege" 1>&2
46
		exit 4
47
	fi
48
	echo -n $"Starting $PROG: "
49
	daemon radvd $OPTIONS
50
	RETVAL=$?
51
	echo
52
	if [ $RETVAL -eq 0 ]; then
53
		touch $LOCKFILE
54
	else
55
		if [ -f $LOCKFILE ]; then
56
			RETVAL=0
57
		fi
58
	fi
59
	;;
60
  stop)
61
	echo -n $"Stopping $PROG: "
62
	killproc radvd
63
	RETVAL=$?
64
	echo
65
	[ $RETVAL -eq 0 ] && rm -f $LOCKFILE
66
	;;
67
  status)
68
	status -p $PIDFILE radvd
69
	RETVAL=$?
70
	;;
71
  restart)
72
	$0 stop
73
	$0 start
74
	RETVAL=$?
75
	;;
76
  reload|force-reload)
77
	echo -n $"Reloading $PROG: "
78
	killproc radvd -HUP
79
	RETVAL=$?
80
	echo
81
	;;
82
  condrestart|try-restart)
83
        if [ -f $LOCKFILE ]; then
84
		$0 stop
85
		$0 start
86
		RETVAL=$?
87
	fi
88
        ;;
89
  *)
90
	echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
91
	exit 2
92
esac
93
 
94
exit $RETVAL