[PVE-User] Feedback

Dietmar Maurer dietmar at proxmox.com
Wed May 14 10:00:51 CEST 2008


 
> 	We don't want to ask users. Instead we need a way to 
> autodetect the best
> 	mirror - but currently I don't know how to do it. Any ideas?
> 	
> 
> 
> Maybe look at some way of telling what country the IP is 
> originating from, or just ask the user for their country and 
> pick one from there
> 

Well, I am thinking of something like:
---------------------------------------------------------
#!/usr/bin/perl -w

use strict;


open (TMP, "traceroute -q 1 -w 2 -n www.debian.org|");

while (my $line = <TMP>) {

    if ($line =~ m/\s*\d\s+(\d+\.\d+\.\d+\.\d+)\s/) {
        my $geoip = `geoiplookup $1`;
        if ($geoip =~ m/GeoIP Country Edition:\s*([A-Z]+),/) {
            print "Country: $1\n";
            last;
        }
    } 
}
close (TMP);
-------------------------------------------------------------

But dont know how reliable that is.

- Dietmar




More information about the pve-user mailing list