Advertisement
vicendominguez

[recover] iplocation script perl template

May 29th, 2012
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.53 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2. # a lot of years ago... recovered
  3. use Geo::IP2Location;
  4.  
  5.  
  6. if ($#ARGV != 1 ) {
  7.         print "usage: nixval-checkip <fichero.bin.ip> <ip>\n";
  8.         exit;
  9. }
  10.  
  11. $fichero=$ARGV[0];
  12. $IP=$ARGV[1];
  13. $obj = Geo::IP2Location->open($fichero);
  14. my ($countryshort, $countrylong, $region, $city, $latitude, $longitude, $zipcode, $timezone, $isp, $domain, $netspeed) = $obj->get_all($IP);
  15.  
  16. print "\nhash:    $obj\n";
  17. print "isp:     $isp\n";
  18. print "ciudad:  $city\n";
  19. print "pais:    $countrylong\n";
  20. print "\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement