logger "Starting DHCP SERVER for eth0"
rm -f /var/run/dhcpcd-eth0.pid
rm -f /var/run/dhcpd.pid
#try and allocate and address just in case!
dhcpcd -dYN -t 10 -h $HOSTNAME eth0
if [ $? -ne 0 ]; then
        logger Starting DHCP Server
#route add -host 255.255.255.255 dev eth0
        ifconfig eth0 address $ethernetAddress netmask $ethernetMask
	sed -e "s/dhcpRouter/$dhcpRouter/" -e "s/ethernetAddress/$ethernetAddress/"  -e "s/ethernetMask/$ethernetMask/" -e "s/dhcpBase/$dhcpBase/" -e "s/dhcpStart/$dhcpStart/"  -e "s/dhcpEnd/$dhcpEnd/" -e "s/dnsPrimary/$dnsPrimary/" -e "s/dnsSecondary/$dnsSecondary/" -e "s/dnsDomain/$dnsDomain/" /SpliceCom/dhcpd.conf > /etc/dhcpd.conf
        sleep 3
        if [ $dhcpRouter != $ethernetAddress ]; then
                route add default gw $dhcpRouter metric 2
        fi
		[ -f /etc/dhcpd_cust.conf ] && DHCP_OPT="-cf /etc/dhcpd_cust.conf"
        /usr/sbin/dhcpd $DHCP_OPT eth0
        if [ $? -ne 0 ]; then
                logger "DHCPD DID NOT START FIRST TIME - REATTEMPT in 5 seconds"
                sleep 3
                /usr/sbin/dhcpd $DHCP_OPT eth0
        fi
else
        logger "DID NOT START DHCP SERVER GOT CLIENT ADDRESS!!! $? "
        dhcpcd -k eth0
        sleep 3
        ifconfig eth0 address $ethernetAddress netmask $ethernetMask
fi
/SpliceCom/set_resolve
/usr/sbin/named
