#!/bin/sh

set -e

remHost="$1"
localDir=/var/cache/xsltdhcp

if [ -e "$localDir/dhcpd.conf.$remHost" ]; then
/usr/sbin/dhcpd -cf "$localDir/dhcpd.conf.$remHost" -t -q || {
	echo "DHCP config check failed!" >&2
	exit 1
}
fi

if [ -e "$localDir/dhcpd6.conf.$remHost" ]; then
/usr/sbin/dhcpd -6 -cf "$localDir/dhcpd6.conf.$remHost" -t -q || {
	echo "DHCP6 config check failed!" >&2
	exit 1
}
fi

exit 0
