ripd.init 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/bin/bash
  2. # chkconfig: - 16 84
  3. # config: /etc/quagga/ripd.conf
  4. ### BEGIN INIT INFO
  5. # Provides: ripd
  6. # Short-Description: RIP routing engine
  7. # Description: RIP routing engine for use with Zebra
  8. ### END INIT INFO
  9. # source function library
  10. . /etc/rc.d/init.d/functions
  11. # Get network config
  12. . /etc/sysconfig/network
  13. # quagga command line options
  14. . /etc/sysconfig/quagga
  15. RETVAL=0
  16. PROG="ripd"
  17. cmd=ripd
  18. LOCK_FILE=/var/lock/subsys/ripd
  19. CONF_FILE=/etc/quagga/ripd.conf
  20. case "$1" in
  21. start)
  22. # Check that networking is up.
  23. [ "${NETWORKING}" = "no" ] && exit 1
  24. # The process must be configured first.
  25. [ -f $CONF_FILE ] || exit 6
  26. if [ `id -u` -ne 0 ]; then
  27. echo $"Insufficient privilege" 1>&2
  28. exit 4
  29. fi
  30. echo -n $"Starting $PROG: "
  31. daemon $cmd -d $RIPD_OPTS -f $CONF_FILE
  32. RETVAL=$?
  33. [ $RETVAL -eq 0 ] && touch $LOCK_FILE
  34. echo
  35. ;;
  36. stop)
  37. echo -n $"Shutting down $PROG: "
  38. killproc $cmd
  39. RETVAL=$?
  40. [ $RETVAL -eq 0 ] && rm -f $LOCK_FILE
  41. echo
  42. ;;
  43. restart|reload|force-reload)
  44. $0 stop
  45. $0 start
  46. RETVAL=$?
  47. ;;
  48. condrestart|try-restart)
  49. if [ -f $LOCK_FILE ]; then
  50. $0 stop
  51. $0 start
  52. fi
  53. RETVAL=$?
  54. ;;
  55. status)
  56. status $cmd
  57. RETVAL=$?
  58. ;;
  59. *)
  60. echo $"Usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
  61. exit 2
  62. esac
  63. exit $RETVAL