zebra.init 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/bash
  2. #
  3. # chkconfig: 2345 15 85
  4. # description: GNU Zebra routing manager
  5. #
  6. # processname: zebra
  7. # config: /etc/quagga/zebra.conf
  8. # source function library
  9. . /etc/rc.d/init.d/functions
  10. # quagga command line options
  11. . /etc/sysconfig/quagga
  12. # Check that networking is up.
  13. [ "${NETWORKING}" = "no" ] && exit 0
  14. # The process must be configured first.
  15. [ -f /etc/quagga/zebra.conf ] || exit 0
  16. RETVAL=0
  17. prog="zebra"
  18. case "$1" in
  19. start)
  20. echo -n $"Starting $prog: "
  21. /sbin/ip route flush proto zebra
  22. daemon /usr/sbin/zebra -d $ZEBRA_OPTS
  23. RETVAL=$?
  24. [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zebra
  25. echo
  26. ;;
  27. stop)
  28. echo -n $"Shutting down $prog: "
  29. killproc zebra
  30. RETVAL=$?
  31. [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zebra
  32. echo
  33. ;;
  34. restart|reload)
  35. $0 stop
  36. $0 start
  37. RETVAL=$?
  38. ;;
  39. condrestart)
  40. if [ -f /var/lock/subsys/zebra ]; then
  41. $0 stop
  42. $0 start
  43. fi
  44. RETVAL=$?
  45. ;;
  46. status)
  47. status zebra
  48. RETVAL=$?
  49. ;;
  50. *)
  51. echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
  52. exit 1
  53. esac
  54. exit $RETVAL