#!/sbin/runscript # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcp.rc6,v 1.11 2004/03/06 03:30:53 vapier Exp $ depend() { need net use logger dns } checkconfig() { if [ ! -f "${CHROOT}/etc/dhcp/dhcpd.conf" ] ; then eerror "No ${CHROOT}/etc/dhcp/dhcpd.conf file exists!" return 1 fi if [ ! -f "${CHROOT}/var/lib/dhcp/dhcpd.leases" ] ; then ebegin "Creating dhcpd.leases" touch "${CHROOT}/var/lib/dhcp/dhcpd.leases" || return 1 eend $? fi ebegin "Setting ownership on dhcpd.leases" chown dhcp:dhcp "${CHROOT}/var/lib/dhcp/dhcpd.leases" || return 1 eend $? } start() { checkconfig || return 1 ebegin "Starting ${CHROOT:+chrooted }dhcpd" start-stop-daemon --start --quiet --exec /usr/sbin/dhcpd \ -- -pf /var/run/dhcp/dhcpd.pid -q \ -user dhcp -group dhcp ${DHCPD_OPTS} \ ${CHROOT:+-chroot ${CHROOT}} ${IFACE} eend $? } stop() { ebegin "Stopping dhcpd" start-stop-daemon --stop --quiet --pidfile \ "${CHROOT}/var/run/dhcp/dhcpd.pid" eend $? }