initd-v4-bird-1.3.8 801 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2012 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. extra_started_commands="reload"
  5. EXE=bird
  6. SOCK="/var/run/${EXE}.ctl"
  7. depend() {
  8. need net
  9. use logger
  10. }
  11. checkconfig() {
  12. if [ ! -f "/etc/${EXE}.conf" ]; then
  13. eerror "Please create /etc/${EXE}.conf"
  14. return 1
  15. fi
  16. return 0
  17. }
  18. start() {
  19. checkconfig || return $?
  20. ebegin "Starting BIRD"
  21. start-stop-daemon --start --exec /usr/sbin/${EXE} -- -c "/etc/${EXE}.conf" -s "${SOCK}"
  22. eend $? "Failed to start BIRD"
  23. }
  24. stop() {
  25. ebegin "Stopping BIRD"
  26. start-stop-daemon --stop --exec /usr/sbin/${EXE}
  27. eend $? "Failed to stop BIRD"
  28. }
  29. reload() {
  30. ebegin "Reloading BIRD"
  31. start-stop-daemon --stop --signal HUP --oknodo --exec /usr/sbin/${EXE}
  32. eend $? "Failed to reload BIRD"
  33. }