#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-misc/udhcp/files/udhcp.init,v 1.3 2004/07/15 00:14:59 agriffis 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 $? }