diff --git a/lib.sh b/lib.sh index d880bc3068..27905d4c51 100644 --- a/lib.sh +++ b/lib.sh @@ -422,14 +422,20 @@ download_geoip_mmdb() { then docker rm -f maxmind rm -f /tmp/dockerenv + # Since only one mmdb file can exist at the same time due to Apache "if" confitions, remove IPInfos config + rm -f "$GEOBLOCK_DIR"/IPInfo-Country.mmdb else docker rm -f maxmind rm -f /tmp/dockerenv print_text_in_color "$ICyan" "Rate limit for Maxmind GeoDatabase reached! We're now trying to get the Country Database from https://ipinfo.io instead." - if ! curl -sfL https://ipinfo.io/data/free/country.mmdb?token="$x8v8GyVQg2UejdPh" -o "$GEOBLOCK_DIR"/GeoLite2-Country.mmdb + if ! curl -sfL https://ipinfo.io/data/free/country.mmdb?token="$x8v8GyVQg2UejdPh" -o "$GEOBLOCK_DIR"/IPInfo-Country.mmdb then msg_box "Sorry, we couldn't get the needed IP geolocation database from any source, please try again in 24 hours." return 1 + else + # Since only one mmdb file can exist at the same time due to Apache "if" confitions, remove MaxMinds config + rm -f "$GEOBLOCK_DIR"/GeoLite2-Country.mmdb + return 0 fi fi unset x8v8GyVQg2UejdPh