aboutsummaryrefslogtreecommitdiff
path: root/net/isc-dhcp/files/dhcpd.init
diff options
context:
space:
mode:
authorAntony Antony <antony@phenome.org>2016-03-25 13:17:46 +0100
committerAntony Antony <antony@phenome.org>2016-03-25 13:17:46 +0100
commit7f594309bfcc18db17a7214eed0f63f3d1bb2e59 (patch)
tree450dc77511474d3d5474ec398119b6b24f15c00c /net/isc-dhcp/files/dhcpd.init
parent4457604f3b1c5fa4e76ddf23dc69bf0c312bc923 (diff)
isc-dhcp: update to 4.3.3. Migrate from oldplackages
Signed-off-by: Antony Antony <antony@phenome.org>
Diffstat (limited to 'net/isc-dhcp/files/dhcpd.init')
-rw-r--r--net/isc-dhcp/files/dhcpd.init33
1 files changed, 33 insertions, 0 deletions
diff --git a/net/isc-dhcp/files/dhcpd.init b/net/isc-dhcp/files/dhcpd.init
new file mode 100644
index 000000000..3ca6c641e
--- /dev/null
+++ b/net/isc-dhcp/files/dhcpd.init
@@ -0,0 +1,33 @@
+#!/bin/sh /etc/rc.common
+
+START=65
+
+lease_file=/tmp/dhcpd.leases
+config_file=/etc/dhcpd.conf
+pid_file=/var/run/dhcpd.pid
+
+start() {
+ if [ ! -e $lease_file ]; then
+ touch $lease_file
+ fi
+
+ /usr/sbin/dhcpd -q -cf $config_file -lf $lease_file -pf $pid_file $dhcp_ifs
+
+ if [ $? -ne 0 ]; then
+ return 1
+ fi
+}
+
+stop() {
+ if [ ! -e $pid_file ]; then
+ return 1
+ fi
+
+ kill -9 `cat $pid_file`
+
+ if [ $? -ne 0 ]; then
+ return 1
+ fi
+
+ rm $pid_file
+}