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-12 22:26:49.885000000 +0400 @@ -1,7 +1,26 @@ #!/bin/sh +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 +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