zebra.init 1.0 KB

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