--- rpms/xtables-addons/contribs9/xtables-addons-1.47.1-bz10860-license_key.patch 2020/01/11 07:27:32 1.1 +++ rpms/xtables-addons/contribs9/xtables-addons-1.47.1-bz10860-license_key.patch 2020/01/14 14:47:14 1.2 @@ -1,18 +1,31 @@ diff -urN xtables-addons-1.47.1.old/geoip/xt_geoip_dl xtables-addons-1.47.1/geoip/xt_geoip_dl --- xtables-addons-1.47.1.old/geoip/xt_geoip_dl 2020-01-11 11:03:01.000000000 +0400 -+++ xtables-addons-1.47.1/geoip/xt_geoip_dl 2020-01-11 11:07:26.045000000 +0400 -@@ -1,7 +1,13 @@ ++++ xtables-addons-1.47.1/geoip/xt_geoip_dl 2020-01-12 22:26:49.885000000 +0400 +@@ -1,7 +1,26 @@ #!/bin/sh -+LicenseKey=$(/sbin/e-smith/config get xt_geoip_LicenseKey) -+#echo $LicenseKey ++status=$(/sbin/e-smith/config getprop geoip status) ++if [[ "$status" != "enabled" ]] ++then ++ echo "Geoip is not enabled. No download." ++ exit 1 ++fi ++ ++LicenseKey=$(/sbin/e-smith/config getprop geoip LicenseKey) ++if [ -z $LicenseKey ] ++then ++ echo "No License Key available. Downloading cannot be performed" ++ exit 1 ++fi + rm -rf GeoLite2-Country-CSV_* -wget -q http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip -+wget -O GeoLite2-Country-CSV.zip -q "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=${LicenseKey}&suffix=zip" -+ -+#wget -q http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.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" ) ++then ++ echo "Error while downloading" ++ exit 2 ++fi + unzip -q GeoLite2-Country-CSV.zip rm -f GeoLite2-Country-CSV.zip