You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.3 KiB

  1. #!/bin/sh /etc/rc.common
  2. START=95
  3. log_success_msg() {
  4. echo "$@"
  5. }
  6. log_warning_msg() {
  7. echo "$@" >&2
  8. }
  9. log_failure_msg() {
  10. echo "$@" >&2
  11. }
  12. self="`dirname $0`"
  13. if [ -r "$self/frrcommon.sh" ]; then
  14. . "$self/frrcommon.sh"
  15. else
  16. . "/usr/sbin/frrcommon.sh"
  17. fi
  18. start() {
  19. daemon_list daemons
  20. watchfrr_options="$watchfrr_options $daemons"
  21. daemon_start watchfrr
  22. }
  23. stop() {
  24. daemon_stop watchfrr
  25. all_stop --reallyall
  26. exit ${still_running:-0}
  27. }
  28. restart() {
  29. daemon_stop watchfrr
  30. all_stop --reallyall
  31. daemon_list daemons
  32. watchfrr_options="$watchfrr_options $daemons"
  33. daemon_start watchfrr
  34. }
  35. status() {
  36. fail=0
  37. print_status watchfrr || fail=1
  38. all_status || fail=1
  39. exit $fail
  40. }
  41. reload() {
  42. if [ ! -x "$RELOAD_SCRIPT" ]; then
  43. log_failure_msg "The frr-pythontools package is required for reload functionality."
  44. exit 1
  45. fi
  46. # restart watchfrr to pick up added daemons.
  47. # NB: This will NOT cause the other daemons to be restarted.
  48. daemon_list daemons
  49. watchfrr_options="$watchfrr_options $daemons"
  50. daemon_stop watchfrr && \
  51. daemon_start watchfrr
  52. NEW_CONFIG_FILE="${2:-$C_PATH/frr.conf}"
  53. [ ! -r $NEW_CONFIG_FILE ] && log_failure_msg "Unable to read new configuration file $NEW_CONFIG_FILE" && exit 1
  54. "$RELOAD_SCRIPT" --reload "$NEW_CONFIG_FILE"
  55. exit $?
  56. }