1 |
diff -urN xtables-addons-1.47.1.old/geoip/xt_geoip_dl xtables-addons-1.47.1/geoip/xt_geoip_dl |
diff -urN xtables-addons-1.47.1.old/geoip/xt_geoip_dl xtables-addons-1.47.1/geoip/xt_geoip_dl |
2 |
--- xtables-addons-1.47.1.old/geoip/xt_geoip_dl 2020-01-11 11:03:01.000000000 +0400 |
--- xtables-addons-1.47.1.old/geoip/xt_geoip_dl 2020-01-11 11:03:01.000000000 +0400 |
3 |
+++ xtables-addons-1.47.1/geoip/xt_geoip_dl 2020-01-11 11:07:26.045000000 +0400 |
+++ xtables-addons-1.47.1/geoip/xt_geoip_dl 2020-01-12 22:26:49.885000000 +0400 |
4 |
@@ -1,7 +1,13 @@ |
@@ -1,7 +1,26 @@ |
5 |
#!/bin/sh |
#!/bin/sh |
6 |
|
|
7 |
+LicenseKey=$(/sbin/e-smith/config get xt_geoip_LicenseKey) |
+status=$(/sbin/e-smith/config getprop geoip status) |
8 |
+#echo $LicenseKey |
+if [[ "$status" != "enabled" ]] |
9 |
|
+then |
10 |
|
+ echo "Geoip is not enabled. No download." |
11 |
|
+ exit 1 |
12 |
|
+fi |
13 |
|
+ |
14 |
|
+LicenseKey=$(/sbin/e-smith/config getprop geoip LicenseKey) |
15 |
|
+if [ -z $LicenseKey ] |
16 |
|
+then |
17 |
|
+ echo "No License Key available. Downloading cannot be performed" |
18 |
|
+ exit 1 |
19 |
|
+fi |
20 |
+ |
+ |
21 |
rm -rf GeoLite2-Country-CSV_* |
rm -rf GeoLite2-Country-CSV_* |
22 |
|
|
23 |
-wget -q http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip |
-wget -q http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip |
24 |
+wget -O GeoLite2-Country-CSV.zip -q "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=${LicenseKey}&suffix=zip" |
+if ( ! wget -O GeoLite2-Country-CSV.zip -q "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=${LicenseKey}&suffix=zip" ) |
25 |
+ |
+then |
26 |
+#wget -q http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip |
+ echo "Error while downloading" |
27 |
|
+ exit 2 |
28 |
|
+fi |
29 |
+ |
+ |
30 |
unzip -q GeoLite2-Country-CSV.zip |
unzip -q GeoLite2-Country-CSV.zip |
31 |
rm -f GeoLite2-Country-CSV.zip |
rm -f GeoLite2-Country-CSV.zip |