summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeemant Kulleen <seemant@gentoo.org>2003-10-30 07:53:00 +0000
committerSeemant Kulleen <seemant@gentoo.org>2003-10-30 07:53:00 +0000
commit326727882309a4a4ccd0316a4f5c5ce6263a72df (patch)
treecadf909ad31c8d9ae42bdb521d19a4754ec13b66 /net-misc/udhcp/files
parentadded initscript (diff)
downloadgentoo-2-326727882309a4a4ccd0316a4f5c5ce6263a72df.tar.gz
gentoo-2-326727882309a4a4ccd0316a4f5c5ce6263a72df.tar.bz2
gentoo-2-326727882309a4a4ccd0316a4f5c5ce6263a72df.zip
added initscript
Diffstat (limited to 'net-misc/udhcp/files')
-rw-r--r--net-misc/udhcp/files/digest-udhcp-0.9.8-r11
-rw-r--r--net-misc/udhcp/files/udhcp.init41
2 files changed, 42 insertions, 0 deletions
diff --git a/net-misc/udhcp/files/digest-udhcp-0.9.8-r1 b/net-misc/udhcp/files/digest-udhcp-0.9.8-r1
new file mode 100644
index 000000000000..0407c3fff96e
--- /dev/null
+++ b/net-misc/udhcp/files/digest-udhcp-0.9.8-r1
@@ -0,0 +1 @@
+MD5 2d7e548820d2ded5e183933cb701defb udhcp-0.9.8.tar.gz 43889
diff --git a/net-misc/udhcp/files/udhcp.init b/net-misc/udhcp/files/udhcp.init
new file mode 100644
index 000000000000..184fda541881
--- /dev/null
+++ b/net-misc/udhcp/files/udhcp.init
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/net-misc/udhcp/files/udhcp.init,v 1.1 2003/10/30 07:52:59 seemant Exp $
+
+depend() {
+ need net
+ use logger dns
+}
+
+checkconfig() {
+ if [ ! -f "${CHROOT}/etc/udhcpd.conf" ] ; then
+ eerror "No ${CHROOT}/etc/udhcpd.conf file exists!"
+ return 1
+ fi
+
+ if [ ! -f "${CHROOT}/var/lib/misc/udhcpd.leases" ] ; then
+ ebegin "Creating dhcpd.leases"
+ touch "${CHROOT}/var/lib/misc/udhcpd.leases" || return 1
+ eend $?
+ fi
+
+ ebegin "Setting ownership on dhcpd.leases"
+ chown dhcp:dhcp "${CHROOT}/var/lib/misc/udhcpd.leases" || return 1
+ eend $?
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting ${CHROOT:+chrooted }dhcpd"
+ start-stop-daemon --start --quiet --exec /usr/sbin/udhcpd \
+ ${CHROOT:+-chroot ${CHROOT}} ${IFACE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping dhcpd"
+ start-stop-daemon --stop --quiet --exec /usr/sbin/udhcpd
+ eend $?
+}