| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
- ##
- ## rc.dhcpd -- Run-Commands
- ##
- %config
- dhcpd_enable="$openpkg_rc_def"
- %common
- dhcpd_pidfile="@l_prefix@/var/dhcpd/dhcpd.pid"
- dhcpd_signal () {
- [ -f $dhcpd_pidfile ] && kill -$1 `cat $dhcpd_pidfile`
- }
- %status -p 200 -u @l_susr@ -o
- dhcpd_usable="unknown"
- dhcpd_active="no"
- opService dhcpd enable yes && \
- dhcpd_signal 0 && dhcpd_active="yes"
- echo "dhcpd_enable=\"$dhcpd_enable\""
- echo "dhcpd_usable=\"$dhcpd_usable\""
- echo "dhcpd_active=\"$dhcpd_active\""
- %start -p 200 -u @l_susr@
- opService dhcpd enable yes || exit 0
- @l_prefix@/sbin/dhcpd >/dev/null 2>&1
- %stop -p 200 -u @l_susr@
- opService dhcpd enable yes || exit 0
- dhcpd_signal TERM
- %restart -u @l_susr@
- opService dhcpd enable yes || exit 0
- dhcpd_signal TERM
- sleep 2
- @l_prefix@/sbin/dhcpd >/dev/null 2>&1
- %reload -u @l_susr@
- opService dhcpd enable yes || exit 0
- dhcpd_signal HUP
|