Getting exact error from dhcpd config test
glen.neff at emc.com
Mon Jan 14 13:17:55 UTC 2013
I encountered this issue as well. I had to punt:
# Re-run test that failed, only give more verbose test failure output.
dhcpd -t -cf /tmp/dhcpconfmaint/dhcpd.conf.tmp > /tmp/dhcpconfmaint/dhcpd-t.fail 2>&1
# Count lines in error output.
fullerrorcount=`wc -l < /tmp/dhcpconfmaint/dhcpd-t.fail`
# Determine lines without top header
withouttopheader=$(( $fullerrorcount - 4 ))
# Determine lines without bottom header
withoutbottomheader=$(( $withouttopheader - 18 ))
tail -$withouttopheader /tmp/dhcpconfmaint/dhcpd-t.fail | head -$withoutbottomheader
From: İbrahim Ercan [ibrahim.ercan at engineer.com]
Received: Monday, 14 Jan 2013, 5:14
To: dhcp-users at lists.isc.org [dhcp-users at lists.isc.org]
Subject: Getting exact error from dhcpd config test
Hi. As I mention on this question ( http://stackoverflow.com/questions/13878706/how-can-i-check-dhcpd-conf-against-syntax-error-without-running-dhcpd ), I want to get exact error from dhcpd -t -cf command.
I tried dhcpd -q -t -cf <file> but this prints nothing. Do I have to use regex? Or is there any way to print only what error is?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dhcp-users