GeoIP update 2006-03-02

add v4 script
This commit is contained in:
zzz
2016-03-15 18:21:50 +00:00
parent a61c44ba42
commit c9f025a44d
3 changed files with 6974 additions and 3279 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -0,0 +1,26 @@
#!/bin/sh
#
# Fetch the latest file from Maxmind,
# and pull out what we need
#
mv GeoIPCountryCSV.zip GeoIPCountryCSV.zip.bak
mv GeoIPCountryWhois.csv GeoIPCountryWhois.csv.bak
wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
unzip GeoIPCountryCSV.zip
echo 'old entry count'
wc -l geoip.txt
GDATE=`ls -l --time-style=long-iso GeoIPCountryCSV.zip | cut -d ' ' -f 6`
echo '# Last updated based on Maxmind GeoLite Country' > geoip.txt
echo "# dated $GDATE" >> geoip.txt
cat << EOF >> geoip.txt
# Script borrowed from Tor
#
# wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip
# unzip GeoIPCountryCSV.zip
# cut -d, -f3-5 < GeoIPCountryWhois.csv|sed 's/"//g' > geoip.txt
# cut -d, -f5,6 < GeoIPCountryWhois.csv |sed 's/"//g' | sort | uniq > countries.txt
EOF
cut -d, -f3-5 < GeoIPCountryWhois.csv|sed 's/"//g' >> geoip.txt
echo 'new entry count'
wc -l geoip.txt
# cut -d, -f5,6 < GeoIPCountryWhois.csv |sed 's/"//g' | sort | uniq > countries.txt