403Webshell
Server IP : 216.92.14.13  /  Your IP : 216.73.216.171
Web Server : Apache
System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64
User : rmlac2fmr ( 1040637)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/bin/geoip-lookup
#!/usr/bin/perl

eval 'exec /usr/bin/perl -w -S $0 ${1+"$@"}'
    if 0; # not running under some shell

=head1 NAME

geoip-lookup - lookup country for IP address or hostname

=head1 SYNOPSIS

 geoip-lookup [-l] <ipaddress|hostname>

=head1 DESCRIPTION

The I<geoip-lookup> program will return the country for the IP address or
hostname given as the first command line argument.
It queries the GeoIP Country database in C</usr/local/share/GeoIP/GeoIP.dat>.

By default it prints the ISO 3166 country code.  Use the C<-l> option
to print the country name.

=head1 EXAMPLE

Lookup up country for IP address 24.24.24.24

 # geoip-lookup 24.24.24.24
 United States

=head1 AUTHOR

T.J. Mather <tjmather@maxmind.com>

=cut

use strict;

use Geo::IP::PurePerl;
use Getopt::Std;

use Locale::Country;

my %opts;
unless (getopt('', \%opts)) {
  usage();
}

my $addr = shift || usage();

my $gi = Geo::IP::PurePerl->new();

my $code = $gi->country_code_by_name($addr);

if ($opts{l}) {
  eval { require Locale::Country; }
    or die "Use of -l flag requires that Locale::Country is installed";
  print Locale::Country::code2country($code);
} else {
  print $code;
}
print "\n";

sub usage
{
  my $progname = $0;
  $progname =~ s,.*/,,;    # only basename left in progname
    $progname =~ s/\.\w*$//; # strip extension if any
  die "Usage: $progname [-l] <ipaddress|hostname>\n";
}

Youez - 2016 - github.com/yon3zu
LinuXploit