blob: 9b412cb9659e1c1e425e839cd70eb48d216befb8 [file] [log] [blame]
paul788cdc62003-01-18 00:22:08 +00001#!/bin/bash
David Warda41242b2012-04-29 16:47:07 -04002# chkconfig: - 16 84
paule835d102003-08-14 05:24:30 +00003# config: /etc/quagga/ripd.conf
paul788cdc62003-01-18 00:22:08 +00004
David Warda41242b2012-04-29 16:47:07 -04005### BEGIN INIT INFO
6# Provides: ripd
7# Short-Description: RIP routing engine
8# Description: RIP routing engine for use with Zebra
9### END INIT INFO
10
paul788cdc62003-01-18 00:22:08 +000011# source function library
12. /etc/rc.d/init.d/functions
13
14# Get network config
15. /etc/sysconfig/network
16
paul15d74e92003-12-30 11:16:21 +000017# quagga command line options
18. /etc/sysconfig/quagga
19
paul788cdc62003-01-18 00:22:08 +000020RETVAL=0
David Warda41242b2012-04-29 16:47:07 -040021PROG="ripd"
22cmd=ripd
23LOCK_FILE=/var/lock/subsys/ripd
24CONF_FILE=/etc/quagga/ripd.conf
paul788cdc62003-01-18 00:22:08 +000025
26case "$1" in
27 start)
David Warda41242b2012-04-29 16:47:07 -040028 # Check that networking is up.
29 [ "${NETWORKING}" = "no" ] && exit 1
30
31 # The process must be configured first.
32 [ -f $CONF_FILE ] || exit 6
33 if [ `id -u` -ne 0 ]; then
34 echo $"Insufficient privilege" 1>&2
35 exit 4
36 fi
37
38 echo -n $"Starting $PROG: "
39 daemon $cmd -d $RIPD_OPTS -f $CONF_FILE
paul788cdc62003-01-18 00:22:08 +000040 RETVAL=$?
David Warda41242b2012-04-29 16:47:07 -040041 [ $RETVAL -eq 0 ] && touch $LOCK_FILE
paul788cdc62003-01-18 00:22:08 +000042 echo
43 ;;
44 stop)
David Warda41242b2012-04-29 16:47:07 -040045 echo -n $"Shutting down $PROG: "
46 killproc $cmd
paul788cdc62003-01-18 00:22:08 +000047 RETVAL=$?
David Warda41242b2012-04-29 16:47:07 -040048 [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
paul788cdc62003-01-18 00:22:08 +000049 echo
50 ;;
David Warda41242b2012-04-29 16:47:07 -040051 restart|reload|force-reload)
52 $0 stop
53 $0 start
paul788cdc62003-01-18 00:22:08 +000054 RETVAL=$?
David Warda41242b2012-04-29 16:47:07 -040055 ;;
56 condrestart|try-restart)
57 if [ -f $LOCK_FILE ]; then
58 $0 stop
paul788cdc62003-01-18 00:22:08 +000059 $0 start
David Warda41242b2012-04-29 16:47:07 -040060 fi
paul788cdc62003-01-18 00:22:08 +000061 RETVAL=$?
David Warda41242b2012-04-29 16:47:07 -040062 ;;
paul788cdc62003-01-18 00:22:08 +000063 status)
David Warda41242b2012-04-29 16:47:07 -040064 status $cmd
paul788cdc62003-01-18 00:22:08 +000065 RETVAL=$?
David Warda41242b2012-04-29 16:47:07 -040066 ;;
paul788cdc62003-01-18 00:22:08 +000067 *)
David Warda41242b2012-04-29 16:47:07 -040068 echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
69 exit 2
paul788cdc62003-01-18 00:22:08 +000070esac
71
72exit $RETVAL