Hello everybody

On Thu, 06 Feb 2020 20:54:50 +1100 Dmitry Smirnov <only...@debian.org> wrote:
> Could it be related to the following upstream changelog entry?
>
> ~~~~
> v3.8 (2020-02-03)
> =================
> - xt_geoip_build now expects the DBIP format as input,
>   Maxmind is thrown out.
> ~~~~
>

Probably yes because the new "build script" xt_geoip_build requires
the csv file downloaded from db-ip.com, instead of the MaxMind one. To
still use the MaxMind csv database you need to extract the old
xt_geoip_build from an old Debian package or from upstream repository.

Attached there is a patch for the "download script" xt_geoip_dl to
download the csv database provided by db-ip.com, the same file
required by the "build script". At least the two scripts are
consistent.


Bye
Simone
Index: xtables-addons-3.8/geoip/xt_geoip_dl
===================================================================
--- xtables-addons-3.8.orig/geoip/xt_geoip_dl
+++ xtables-addons-3.8/geoip/xt_geoip_dl
@@ -1,7 +1,14 @@
 #!/bin/sh
+# Download free "IP to Country Lite Database" from db-ip.com, licensed under CC-BY-4.0

-rm -rf GeoLite2-Country-CSV_*
+# try to download this month file
+wget -O dbip-country-lite.csv.gz "https://download.db-ip.com/free/dbip-country-lite-$(date +'%Y-%m').csv.gz"

-wget -q http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip
-unzip -q GeoLite2-Country-CSV.zip
-rm -f GeoLite2-Country-CSV.zip
+# in case of error try to download previous month file
+if [ $? -ne 0 ]; then
+  wget -O dbip-country-lite.csv.gz "https://download.db-ip.com/free/dbip-country-lite-$(date -d '-1 month' +'%Y-%m').csv.gz"
+fi
+
+# uncompress and exit
+gunzip dbip-country-lite.csv.gz
+exit $?

Reply via email to