Fixed an issue with AS lookups and some formatting glitches

This commit is contained in:
Maff 2014-03-05 01:19:03 +00:00
parent 70b1a2edad
commit b1485bbf55
1 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,8 @@ sub do_as_lookup {
my $asdesc = "";
foreach(@results) {
$asname = $1 if /as-name:\s+(.+)$/;
$asdesc = $1 if /descr:\s+(.+)$/;
$asdesc .= ", " if length $asdesc > 0 and /^descr/;
$asdesc .= $1 if /descr:\s+(.+)$/;
}
return "$asn $asname - $asdesc";
}
@ -50,8 +51,7 @@ sub do_subnet_lookup {
return "$sub€$result€$descr";
}
my $target = shift || die "Please provide an ASnum or IP/subnet to look up\n";
my $target = uc shift || die "Please provide an ASnum or IP/subnet to look up\n";
if($target =~ /^AS/) {
print "$target is ".do_as_lookup $target;print "\n";
exit