Check that the rcodes in the 2 messages are the same
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
||||
# SOFTWARE.
|
||||
|
||||
# $Id: digcomp.pl,v 1.4 2000/06/22 21:51:25 tale Exp $
|
||||
# $Id: digcomp.pl,v 1.5 2000/07/07 21:43:49 bwelling Exp $
|
||||
|
||||
# Compare two files, each with the output from dig, for differences.
|
||||
# Ignore "unimportant" differences, like ordering of NS lines, TTL's,
|
||||
@@ -27,6 +27,8 @@ $file2 = $ARGV[1];
|
||||
$count = 0;
|
||||
$firstname = "";
|
||||
$status = 0;
|
||||
$rcode1 = "none";
|
||||
$rcode2 = "none";
|
||||
|
||||
open(FILE1, $file1) || die("$! $file1");
|
||||
while (<FILE1>) {
|
||||
@@ -51,6 +53,9 @@ while (<FILE1>) {
|
||||
$entry{"$name ; $class.$type ; $value"} = $_;
|
||||
}
|
||||
}
|
||||
elsif (/^;.+status:\s+(\S+).+$/) {
|
||||
$rcode1 = $1;
|
||||
}
|
||||
}
|
||||
close (FILE1);
|
||||
|
||||
@@ -78,6 +83,9 @@ while (<FILE2>) {
|
||||
$status = 1;
|
||||
}
|
||||
}
|
||||
elsif (/^;.+status:\s+(\S+).+$/) {
|
||||
$rcode2 = $1;
|
||||
}
|
||||
}
|
||||
close (FILE2);
|
||||
|
||||
@@ -92,4 +100,9 @@ foreach $key (keys(%entry)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($rcode1 != $rcode2) {
|
||||
print ("< status: $rcode1\n");
|
||||
print ("> status: $rcode2\n");
|
||||
}
|
||||
|
||||
exit($status);
|
||||
|
||||
Reference in New Issue
Block a user