Blame SOURCES/rdisc.initd

4b0239
#!/bin/bash
4b0239
#
4b0239
# $Id: rdisc,v 1.5 2005/04/05 10:06:01 bastian Exp $
4b0239
#
4b0239
### BEGIN INIT INFO
4b0239
# Provides: rdisc
4b0239
# Short-Description: This is a daemon which discovers routers on the local subnet.
4b0239
# Description: This is a daemon which discovers routers on the local subnet.
4b0239
### END INIT INFO
4b0239
4b0239
# chkconfig: - 41 89
4b0239
# config: /etc/sysconfig/rdisc
4b0239
4b0239
# Source function library.
4b0239
. /etc/init.d/functions
4b0239
. /etc/sysconfig/network
4b0239
4b0239
LOCKFILE=/var/lock/subsys/rdisc
4b0239
4b0239
# Set default options in /etc/sysconfig/rdisc
4b0239
[ -f /etc/sysconfig/rdisc ] && . /etc/sysconfig/rdisc
4b0239
RDISCOPTS=${RDISCOPTS:-"-s"}
4b0239
4b0239
start() {
4b0239
	# Check that networking is configured.
4b0239
	[ ${NETWORKING} = "no" ] && exit 1
4b0239
4b0239
	echo -n $"Starting router discovery: "
4b0239
	if [ $UID -ne 0 ]; then
4b0239
                RETVAL=4
4b0239
                failure
4b0239
        else
4b0239
		daemon /sbin/rdisc $RDISCOPTS
4b0239
		RETVAL=$?
4b0239
		[ $RETVAL -eq 0 ] && touch $LOCKFILE
4b0239
	fi;
4b0239
	echo
4b0239
	return $RETVAL
4b0239
}
4b0239
4b0239
stop() {
4b0239
	echo -n $"Shutting down router discovery services: "
4b0239
	if [ $UID -ne 0 ]; then
4b0239
                RETVAL=4
4b0239
                failure
4b0239
        else
4b0239
        	killproc /sbin/rdisc
4b0239
		RETVAL=$?
4b0239
	        [ $RETVAL -eq 0 ] && rm -f $LOCKFILE
4b0239
        fi;
4b0239
	echo
4b0239
	return $RETVAL
4b0239
}
4b0239
4b0239
restart() {
4b0239
	stop
4b0239
	start
4b0239
}
4b0239
4b0239
RETVAL=0
4b0239
4b0239
# See how we were called.
4b0239
case "$1" in
4b0239
  start)
4b0239
	start
4b0239
	;;
4b0239
  stop)
4b0239
	stop
4b0239
	;;
4b0239
  status)
4b0239
	status rdisc
4b0239
	;;
4b0239
  restart|reload)
4b0239
	restart
4b0239
	;;
4b0239
  condrestart)
4b0239
	if status $prog > /dev/null; then
4b0239
	    stop
4b0239
	    start
4b0239
	fi
4b0239
	;;
4b0239
  *)
4b0239
	echo $"Usage: $0 {start|stop|status|restart|reload}"
4b0239
	exit 2
4b0239
esac
4b0239
4b0239
exit $?