Getting exact error from dhcpd config test
Neff, Glen
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
-----Original Message-----
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?
--
Ibrahim Ercan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20130114/5e6c6d36/attachment.html>
More information about the dhcp-users
mailing list