#!/bin/sh
#
# $NetBSD: isc_dhclient.sh,v 1.1 2009/01/04 00:59:23 adrianp Exp $
#

# PROVIDE: dhclient
# REQUIRE: network mountcritlocal
# BEFORE:  NETWORKING
#
#	Note that there no syslog logging of dhclient messages at boot because
#	dhclient needs to start before services that syslog depends upon do.
#

if [ -f /etc/rc.subr ]; then
        . /etc/rc.subr
fi

name="isc_dhclient"
rcvar="${name}"
command="/usr/pkg/sbin/dhclient"
pidfile="/var/run/isc-dhcp/isc-dhclient.pid"
start_precmd="isc_dhclient_precmd"

isc_dhclient_precmd()
{
	if [ ! -d /var/run/isc-dhcp ]; then
		/bin/mkdir -p /var/run/isc-dhcp
		/bin/chmod 0770 /var/run/isc-dhcp
	fi
}

load_rc_config $rcvar
run_rc_command "$1"
