summaryrefslogtreecommitdiff
path: root/dhcp
diff options
context:
space:
mode:
authorThomas Penteker <tek@serverop.de>2015-11-30 01:12:35 +0100
committerThomas Penteker <tek@serverop.de>2015-11-30 01:12:35 +0100
commitcfae243d3544ee0a1d19f890439df44af2ac3490 (patch)
tree8516d7b78b5cc7fbf4c14a989955b64ffbc5f6f0 /dhcp
parent9753788682d8cbd649e88adf5ce0aafdba99c8a7 (diff)
downloadcontrib-cfae243d3544ee0a1d19f890439df44af2ac3490.tar.gz
contrib-cfae243d3544ee0a1d19f890439df44af2ac3490.tar.xz
dhcp: add ssd-based scripts, thanks frinnst!
Diffstat (limited to 'dhcp')
-rw-r--r--dhcp/.md5sum4
-rw-r--r--dhcp/dhclient37
-rw-r--r--dhcp/dhcpd36
3 files changed, 55 insertions, 22 deletions
diff --git a/dhcp/.md5sum b/dhcp/.md5sum
index b0405816e..21a03a340 100644
--- a/dhcp/.md5sum
+++ b/dhcp/.md5sum
@@ -1,4 +1,4 @@
157549658aba092b0d26aa1df3943051 default-config.diff
-2c0abf8990ab061accefc5d3d0f655d1 dhclient
+d668fba757e27f197729972750f89859 dhclient
c5577b09c9017cdd319a11ff6364268e dhcp-4.3.3.tar.gz
-51665125f8360c6cc1ef59ad6cd8cf84 dhcpd
+3d6b3dbd3cabb0efcfada56cd3e6c0a4 dhcpd
diff --git a/dhcp/dhclient b/dhcp/dhclient
index 75501f722..9163753ba 100644
--- a/dhcp/dhclient
+++ b/dhcp/dhclient
@@ -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
+
diff --git a/dhcp/dhcpd b/dhcp/dhcpd
index bf4fe5f16..0c7898ae4 100644
--- a/dhcp/dhcpd
+++ b/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

Generated by cgit