]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_asn: fix download script
authorPhilip Prindeville <philipp@redfish-solutions.com>
Mon, 10 Jul 2023 04:37:49 +0000 (06:37 +0200)
committerJan Engelhardt <jengelh@inai.de>
Mon, 10 Jul 2023 23:19:57 +0000 (01:19 +0200)
If the server ever existed, it's been retired now.  Use the download
server instead.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
asn/xt_asn_dl

index 42320365b059bec993767b81d722c589b46ca23d..60bd598e04ad8350a9bac10fbf8839ab4b7a4485 100755 (executable)
@@ -1,5 +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-ASN-CSV_*
-wget -q http://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN-CSV.zip
+
+wget -q -OGeoLite2-ASN-CSV.zip "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-ASN-CSV&license_key=${licence_key}&suffix=zip"
 unzip -q GeoLite2-ASN-CSV.zip
 rm -f GeoLite2-ASN-CSV.zip