fix: [GeoIP] Small refactor

pull/144/head
Steve Clement 2020-02-20 14:45:03 +08:00
parent 4de261ee62
commit 8d28c5128d
No known key found for this signature in database
GPG Key ID: 69A20F509BE4AEE9
1 changed files with 1 additions and 3 deletions

View File

@ -147,13 +147,11 @@ pushd data
# The following lines do not work any more, see: https://blog.maxmind.com/2019/12/18/significant-changes-to-accessing-and-using-geolite2-databases/
#wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz -O GeoLite2-City.tar.gz
read -p "Please paste your Max Mind License key: " MM_LIC
wget "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${MM_LIC}&suffix=tar.gz" -O GeoLite2-City.tar.gz
wget "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${MM_LIC}&suffix=tar.gz.sha256" -O GeoLite2-City.tar.gz.sha256
cat GeoLite2-City.tar.gz.sha256 |sed 's/_.*/.tar.gz/' > GeoLite2-City.tar.gz.sha256
while [ "$(sha256sum -c GeoLite2-City.tar.gz.sha256 >/dev/null; echo $?)" != "0" ]; do
echo "Redownloading GeoLite Assets, if this loops, CTRL-C and investigate"
wget "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${MM_LIC}&suffix=tar.gz" -O GeoLite2-City.tar.gz
wget "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${MM_LIC}&suffix=tar.gz.sha256" -O GeoLite2-City.tar.gz.sha256
cat GeoLite2-City.tar.gz.sha256 |sed 's/_.*/.tar.gz/' > GeoLite2-City.tar.gz.sha256
sleep 3
done
tar xvfz GeoLite2-City.tar.gz