rc.dhcpd 987 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
  2. ##
  3. ## rc.dhcpd -- Run-Commands
  4. ##
  5. %config
  6. dhcpd_enable="$openpkg_rc_def"
  7. %common
  8. dhcpd_pidfile="@l_prefix@/var/dhcpd/dhcpd.pid"
  9. dhcpd_signal () {
  10. [ -f $dhcpd_pidfile ] && kill -$1 `cat $dhcpd_pidfile`
  11. }
  12. %status -p 200 -u @l_susr@ -o
  13. dhcpd_usable="unknown"
  14. dhcpd_active="no"
  15. opService dhcpd enable yes && \
  16. dhcpd_signal 0 && dhcpd_active="yes"
  17. echo "dhcpd_enable=\"$dhcpd_enable\""
  18. echo "dhcpd_usable=\"$dhcpd_usable\""
  19. echo "dhcpd_active=\"$dhcpd_active\""
  20. %start -p 200 -u @l_susr@
  21. opService dhcpd enable yes || exit 0
  22. @l_prefix@/sbin/dhcpd >/dev/null 2>&1
  23. %stop -p 200 -u @l_susr@
  24. opService dhcpd enable yes || exit 0
  25. dhcpd_signal TERM
  26. %restart -u @l_susr@
  27. opService dhcpd enable yes || exit 0
  28. dhcpd_signal TERM
  29. sleep 2
  30. @l_prefix@/sbin/dhcpd >/dev/null 2>&1
  31. %reload -u @l_susr@
  32. opService dhcpd enable yes || exit 0
  33. dhcpd_signal HUP