Add option -v (verbose)
This commit is contained in:
parent
7aa8246502
commit
8187b62fc6
12
dns/check.pl
12
dns/check.pl
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/perl -w
|
||||
#!/usr/bin/perl
|
||||
use warnings;
|
||||
use strict;
|
||||
use Net::DNS;
|
||||
|
||||
|
@ -7,6 +8,13 @@ sub usage {
|
|||
exit(1);
|
||||
}
|
||||
|
||||
my $verbose;
|
||||
|
||||
if (($ARGV[0] || '') eq '-v') {
|
||||
$verbose = 1;
|
||||
shift @ARGV;
|
||||
}
|
||||
|
||||
usage() unless (@ARGV == 1);
|
||||
|
||||
# generic resolver
|
||||
|
@ -57,6 +65,7 @@ sub check_ptr {
|
|||
return;
|
||||
}
|
||||
for my $name (@names) {
|
||||
print "I: [$addr] -> $name\n" if $verbose;
|
||||
check_a($name, $addr);
|
||||
}
|
||||
}
|
||||
|
@ -92,6 +101,7 @@ sub check_a {
|
|||
return;
|
||||
}
|
||||
for my $addr (@addrs) {
|
||||
print "I: $name -> [$addr]\n" if $verbose;
|
||||
check_ptr($addr, $name);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue