Package: xtables-addons / 3.13-1

change-download-to-dbip.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Last-Update: 2020-08-29
Forwarded: needs-forwarding
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=950780
Author: Simone Rossetto <simros85@gmail.com>
Description: download the csv database provided by db-ip.com, the same
 file required by the "build script".
 .
 Upstream now uses db-ip.com too, so we just retain the fall-back to
 last month.

--- a/geoip/xt_geoip_dl
+++ b/geoip/xt_geoip_dl
@@ -1,5 +1,12 @@
 #!/bin/sh
 
+# try to download this month file
 timestamp=$(date "+%Y-%m")
 wget -q "https://download.db-ip.com/free/dbip-country-lite-$timestamp.csv.gz" -O- | \
 	gzip -cd >dbip-country-lite.csv
+
+if [ $? -ne 0 ]; then
+  timestamp=$(date -d '-1 month' "+%Y-%m")
+  wget -q "https://download.db-ip.com/free/dbip-country-lite-$timestamp.csv.gz" -O- | \
+  	gzip -cd >dbip-country-lite.csv
+fi