Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/bash
2
#
3
# $Id$
4
#
5
### BEGIN INIT INFO
6
# Provides: rdisc
7
# Short-Description: This is a daemon which discovers routers on the local subnet.
8
# Description: This is a daemon which discovers routers on the local subnet.
9
### END INIT INFO
10
 
11
# chkconfig: - 41 89
12
# config: /etc/sysconfig/rdisc
13
 
14
# Source function library.
15
. /etc/init.d/functions
16
. /etc/sysconfig/network
17
 
18
#
19
# Set default options.  Override the defaults and define
20
# custom options in /etc/sysconfig/rdisc
21
#
22
RDISCOPTS="-s"
23
LOCKFILE=/var/lock/subsys/rdisc
24
 
25
[ -f /etc/sysconfig/rdisc ] && . /etc/sysconfig/rdisc
26
 
27
 
28
start() {
29
	# Check that networking is configured.
30
	[ ${NETWORKING} = "no" ] && exit 1
31
 
32
	echo -n $"Starting router discovery: "
33
	if [ $UID -ne 0 ]; then
34
                RETVAL=4
35
                failure
36
        else
37
		daemon /sbin/rdisc $RDISCOPTS
38
		RETVAL=$?
39
		[ $RETVAL -eq 0 ] && touch $LOCKFILE
40
	fi;
41
	echo
42
	return $RETVAL
43
}
44
 
45
stop() {
46
	echo -n $"Shutting down router discovery services: "
47
	if [ $UID -ne 0 ]; then
48
                RETVAL=4
49
                failure
50
        else
51
        	killproc /sbin/rdisc
52
		RETVAL=$?
53
	        [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
54
        fi;
55
	echo
56
	return $RETVAL
57
}
58
 
59
restart() {
60
	stop
61
	start
62
}
63
 
64
RETVAL=0
65
 
66
# See how we were called.
67
case "$1" in
68
  start)
69
	start
70
	;;
71
  stop)
72
	stop
73
	;;
74
  status)
75
	status rdisc
76
	;;
77
  restart|reload)
78
	restart
79
	;;
80
  condrestart)
81
	if status $prog > /dev/null; then
82
	    stop
83
	    start
84
	fi
85
	;;
86
  *)
87
	echo $"Usage: $0 {start|stop|status|restart|reload}"
88
	exit 2
89
esac
90
 
91
exit $?