]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
geoip: use correct download URL for MaxMind DBs
authorJeremy Sowden <jeremy@azazel.net>
Sun, 22 Nov 2020 14:05:30 +0000 (15:05 +0100)
committerJan Engelhardt <jengelh@inai.de>
Tue, 24 Nov 2020 17:39:00 +0000 (18:39 +0100)
The download URL for the GeoLite2 DBs has changed and includes a
licence key. Update the download script to read the key from file or
stdin and use the correct URL.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
geoip/xt_geoip_dl_maxmind

index 1de60442a8040f55d775d134d7a8ea707582d71e..d5640336c1c0bb909e2a60e84bcab1186a326497 100755 (executable)
@@ -1,7 +1,16 @@
 #!/bin/sh
 
+if [ $# -eq 1 ]; then
+    exec <$1
+elif [ $# -ne 0 ]; then
+    echo $(basename $0) [ licence_key_file ] 1>&2
+    exit 1
+fi
+
+read licence_key
+
 rm -rf GeoLite2-Country-CSV_*
 
-wget -q http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip
+wget -q -OGeoLite2-Country-CSV.zip "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=${licence_key}&suffix=zip"
 unzip -q GeoLite2-Country-CSV.zip
 rm -f GeoLite2-Country-CSV.zip