bgpd.init 1.1 KB

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