#!/bin/sh
#
# $NetBSD: isc_dhcrelay.sh,v 1.2 2017/08/05 20:09:27 bsiegert Exp $
#

# PROVIDE: dhcrelay
# REQUIRE: 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_dhcrelay"
rcvar="${name}"
command="/usr/pkg/sbin/dhcrelay"
pidfile="/var/run/isc-dhcp/isc-dhcrelay.pid"
start_precmd="isc_dhcrelay_precmd"

isc_dhcrelay_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"
