| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 2 | # chkconfig: - 16 84 |
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 3 | # config: /etc/quagga/isisd.conf |
| 4 | |||||
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 5 | ### BEGIN INIT INFO |
| 6 | # Provides: isisd | ||||
| 7 | # Short-Description: IS-IS routing engine | ||||
| 8 | # Description: IS-IS routing engine for use with Zebra | ||||
| 9 | ### END INIT INFO | ||||
| 10 | |||||
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 11 | # source function library |
| 12 | . /etc/rc.d/init.d/functions | ||||
| 13 | |||||
| 14 | # Get network config | ||||
| 15 | . /etc/sysconfig/network | ||||
| 16 | |||||
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 17 | # quagga command line options |
| 18 | . /etc/sysconfig/quagga | ||||
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 19 | |
| 20 | RETVAL=0 | ||||
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 21 | PROG="isisd" |
| 22 | cmd=isisd | ||||
| 23 | LOCK_FILE=/var/lock/subsys/isisd | ||||
| 24 | CONF_FILE=/etc/quagga/isisd.conf | ||||
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 25 | |
| 26 | case "$1" in | ||||
| 27 | start) | ||||
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 28 | # 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 $ISISD_OPTS -f $CONF_FILE | ||||
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 40 | RETVAL=$? |
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 41 | [ $RETVAL -eq 0 ] && touch $LOCK_FILE |
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 42 | echo |
| 43 | ;; | ||||
| 44 | stop) | ||||
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 45 | echo -n $"Shutting down $PROG: " |
| 46 | killproc $cmd | ||||
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 47 | RETVAL=$? |
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 48 | [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE |
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 49 | echo |
| 50 | ;; | ||||
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 51 | restart|reload|force-reload) |
| 52 | $0 stop | ||||
| 53 | $0 start | ||||
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 54 | RETVAL=$? |
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 55 | ;; |
| 56 | condrestart|try-restart) | ||||
| 57 | if [ -f $LOCK_FILE ]; then | ||||
| 58 | $0 stop | ||||
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 59 | $0 start |
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 60 | fi |
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 61 | RETVAL=$? |
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 62 | ;; |
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 63 | status) |
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 64 | status $cmd |
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 65 | RETVAL=$? |
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 66 | ;; |
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 67 | *) |
| David Ward | a41242b | 2012-04-29 16:47:07 -0400 | [diff] [blame] | 68 | echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}" |
| 69 | exit 2 | ||||
| paul | 15d74e9 | 2003-12-30 11:16:21 +0000 | [diff] [blame] | 70 | esac |
| 71 | |||||
| 72 | exit $RETVAL | ||||