forked from ports/contrib
dhcp: add ssd-based scripts, thanks frinnst!
This commit is contained in:
parent
9753788682
commit
cfae243d35
@ -1,4 +1,4 @@
|
||||
157549658aba092b0d26aa1df3943051 default-config.diff
|
||||
2c0abf8990ab061accefc5d3d0f655d1 dhclient
|
||||
d668fba757e27f197729972750f89859 dhclient
|
||||
c5577b09c9017cdd319a11ff6364268e dhcp-4.3.3.tar.gz
|
||||
51665125f8360c6cc1ef59ad6cd8cf84 dhcpd
|
||||
3d6b3dbd3cabb0efcfada56cd3e6c0a4 dhcpd
|
||||
|
@ -3,21 +3,38 @@
|
||||
# /etc/rc.d/dhcpcd: start/stop dhcp client
|
||||
#
|
||||
|
||||
SSD=/sbin/start-stop-daemon
|
||||
PROG=/usr/sbin/dhclient
|
||||
PID=/var/run/dhclient.pid
|
||||
OPTS="-q"
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
/usr/sbin/dhclient -q
|
||||
;;
|
||||
$SSD --start --pidfile $PID --exec $PROG -- $OPTS
|
||||
;;
|
||||
stop)
|
||||
test -f /var/run/dhclient.pid && kill $(cat /var/run/dhclient.pid)
|
||||
;;
|
||||
$SSD --stop --remove-pidfile --retry 10 --pidfile $PID
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
reload)
|
||||
$SSD --stop --signal HUP --pidfile $PID
|
||||
;;
|
||||
status)
|
||||
$SSD --status --pidfile $PID
|
||||
case $? in
|
||||
0) echo "$PROG is running" ;;
|
||||
1) echo "$PROG is not running but the pid file $PID exists" ;;
|
||||
3) echo "$PROG is not running" ;;
|
||||
4) echo "Unable to determine the program status" ;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 [start|stop|restart]"
|
||||
;;
|
||||
echo "usage: $0 [start|stop|restart|reload|status]"
|
||||
;;
|
||||
esac
|
||||
|
||||
# End of file
|
||||
|
||||
|
36
dhcp/dhcpd
36
dhcp/dhcpd
@ -3,21 +3,37 @@
|
||||
# /etc/rc.d/dhcpd: start/stop dhcp daemon
|
||||
#
|
||||
|
||||
SSD=/sbin/start-stop-daemon
|
||||
PROG=/usr/sbin/dhcpd
|
||||
PID=/var/run/dhcpd.pid
|
||||
OPTS="-q"
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
/usr/sbin/dhcpd -q
|
||||
;;
|
||||
$SSD --start --pidfile $PID --exec $PROG -- $OPTS
|
||||
;;
|
||||
stop)
|
||||
killall -q /usr/sbin/dhcpd
|
||||
;;
|
||||
$SSD --stop --remove-pidfile --retry 10 --pidfile $PID
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
$0 stop
|
||||
$0 start
|
||||
;;
|
||||
reload)
|
||||
$SSD --stop --signal HUP --pidfile $PID
|
||||
;;
|
||||
status)
|
||||
$SSD --status --pidfile $PID
|
||||
case $? in
|
||||
0) echo "$PROG is running" ;;
|
||||
1) echo "$PROG is not running but the pid file $PID exists" ;;
|
||||
3) echo "$PROG is not running" ;;
|
||||
4) echo "Unable to determine the program status" ;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 [start|stop|restart]"
|
||||
;;
|
||||
echo "usage: $0 [start|stop|restart|reload|status]"
|
||||
;;
|
||||
esac
|
||||
|
||||
# End of file
|
||||
|
Loading…
x
Reference in New Issue
Block a user