bgpd.init 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. #
  3. # chkconfig: - 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. # Check that networking is up.
  13. [ "${NETWORKING}" = "no" ] && exit 0
  14. # The process must be configured first.
  15. [ -f /etc/zebra/bgpd.conf ] || exit 0
  16. RETVAL=0
  17. prog="bgpd"
  18. case "$1" in
  19. start)
  20. echo -n $"Starting $prog: "
  21. daemon /usr/sbin/bgpd -d
  22. RETVAL=$?
  23. [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bgpd
  24. echo
  25. ;;
  26. stop)
  27. echo -n $"Shutting down $prog: "
  28. killproc bgpd
  29. RETVAL=$?
  30. [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bgpd
  31. echo
  32. ;;
  33. restart|reload)
  34. $0 stop
  35. $0 start
  36. RETVAL=$?
  37. ;;
  38. condrestart)
  39. if [ -f /var/lock/subsys/bgpd ]; then
  40. $0 stop
  41. $0 start
  42. fi
  43. RETVAL=$?
  44. ;;
  45. status)
  46. status bgpd
  47. RETVAL=$?
  48. ;;
  49. *)
  50. echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
  51. exit 1
  52. esac
  53. exit $RETVAL