version 1.1.1.1, 2012/02/21 17:26:12
|
version 1.1.1.2, 2012/10/09 09:22:29
|
Line 1
|
Line 1
|
#!/bin/bash |
#!/bin/bash |
# | # chkconfig: - 16 84 |
# chkconfig: 2345 16 84 | |
# description: A RIP routing engine for use with Zebra | |
# | |
# processname: ripd | |
# config: /etc/quagga/ripd.conf |
# config: /etc/quagga/ripd.conf |
|
|
|
### BEGIN INIT INFO |
|
# Provides: ripd |
|
# Short-Description: RIP routing engine |
|
# Description: RIP routing engine for use with Zebra |
|
### END INIT INFO |
|
|
# source function library |
# source function library |
. /etc/rc.d/init.d/functions |
. /etc/rc.d/init.d/functions |
|
|
Line 15
|
Line 17
|
# quagga command line options |
# quagga command line options |
. /etc/sysconfig/quagga |
. /etc/sysconfig/quagga |
|
|
# Check that networking is up. |
|
[ "${NETWORKING}" = "no" ] && exit 0 |
|
|
|
# The process must be configured first. |
|
[ -f /etc/quagga/ripd.conf ] || exit 0 |
|
|
|
RETVAL=0 |
RETVAL=0 |
prog="ripd" | PROG="ripd" |
| cmd=ripd |
| LOCK_FILE=/var/lock/subsys/ripd |
| CONF_FILE=/etc/quagga/ripd.conf |
|
|
case "$1" in |
case "$1" in |
start) |
start) |
echo -n $"Starting $prog: " | # Check that networking is up. |
daemon /usr/sbin/ripd -d $RIPD_OPTS | [ "${NETWORKING}" = "no" ] && exit 1 |
| |
| # The process must be configured first. |
| [ -f $CONF_FILE ] || exit 6 |
| if [ `id -u` -ne 0 ]; then |
| echo $"Insufficient privilege" 1>&2 |
| exit 4 |
| fi |
| |
| echo -n $"Starting $PROG: " |
| daemon $cmd -d $RIPD_OPTS -f $CONF_FILE |
RETVAL=$? |
RETVAL=$? |
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripd | [ $RETVAL -eq 0 ] && touch $LOCK_FILE |
echo |
echo |
;; |
;; |
stop) |
stop) |
echo -n $"Shutting down $prog: " | echo -n $"Shutting down $PROG: " |
killproc ripd | killproc $cmd |
RETVAL=$? |
RETVAL=$? |
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripd | [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE |
echo |
echo |
;; |
;; |
restart|reload) | restart|reload|force-reload) |
$0 stop | $0 stop |
$0 start | $0 start |
RETVAL=$? |
RETVAL=$? |
;; | ;; |
condrestart) | condrestart|try-restart) |
if [ -f /var/lock/subsys/ripd ]; then | if [ -f $LOCK_FILE ]; then |
$0 stop | $0 stop |
$0 start |
$0 start |
fi | fi |
RETVAL=$? |
RETVAL=$? |
;; | ;; |
status) |
status) |
status ripd | status $cmd |
RETVAL=$? |
RETVAL=$? |
;; | ;; |
*) |
*) |
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}" | echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}" |
exit 1 | exit 2 |
esac |
esac |
|
|
exit $RETVAL |
exit $RETVAL |