bgpd.sh.in 683 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. #
  3. # bgpd is part of the quagga routing beast
  4. #
  5. # PROVIDE: bgpd
  6. # REQUIRE: zebra
  7. ##
  8. PATH=/sbin:/bin:/usr/sbin:/usr/bin:@prefix@/sbin:@prefix@/bin
  9. export PATH
  10. if [ -f /etc/rc.subr ]
  11. then
  12. . /etc/rc.subr
  13. fi
  14. name="bgpd"
  15. rcvar=$name
  16. required_files="@sysconfdir@/${name}.conf"
  17. command="@prefix@/sbin/${name}"
  18. command_args="-d"
  19. start_precmd="zebra_precmd"
  20. socket_dir=@localstatedir@
  21. pidfile="${socket_dir}/${name}.pid"
  22. zebra_precmd()
  23. {
  24. rc_flags="$(
  25. set -- $rc_flags
  26. while [ $# -ne 0 ]; do
  27. if [ X"$1" = X-P -o X"$1" = X-A ]; then
  28. break
  29. fi
  30. shift
  31. done
  32. if [ $# -eq 0 ]; then
  33. echo "-P 0"
  34. fi
  35. ) $rc_flags"
  36. }
  37. load_rc_config $name
  38. run_rc_command "$1"