#!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-misc/udhcp/files/udhcp.rc,v 1.2 2007/02/23 12:00:10 uberlord Exp $ depend() { use net logger } checkconfig() { if [ ! -f /etc/udhcpd.conf ] ; then eerror "No /etc/udhcpd.conf file exists" return 1 fi if [ ! -e /var/lib/misc/udhcpd.leases ] ; then ebegin "Creating udhcpd.leases" touch /var/lib/misc/udhcpd.leases || return 1 eend $? fi } start() { checkconfig || return 1 ebegin "Starting udhcpd" start-stop-daemon --start --exec /sbin/udhcpd \ --pidfile /var/run/udhcpd.pid >/dev/null eend $? } stop() { ebegin "Stopping udhcpd" start-stop-daemon --stop --exec /sbin/udhcpd \ --pidfile /var/run/udhcpd.pid eend $? }