From e8c76202b61d0d23f558204e713776f604fdcd44 Mon Sep 17 00:00:00 2001 From: Nicolas Gudino Date: Fri, 10 May 2024 16:44:07 -0400 Subject: [PATCH] Follow redirects on curl requests. Fixes downloading Maxmind Geolite since they changed behaviour on January 2024 --- build/4.0/files/geoip_update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/4.0/files/geoip_update.sh b/build/4.0/files/geoip_update.sh index 400d07c..709b620 100755 --- a/build/4.0/files/geoip_update.sh +++ b/build/4.0/files/geoip_update.sh @@ -219,7 +219,7 @@ function fromGeolite2 { fi COUNTRYURL='http://download.geonames.org/export/dump/countryInfo.txt' - if ! curl -s $COUNTRYURL > /tmp/CountryInfo.txt + if ! curl -s -L $COUNTRYURL > /tmp/CountryInfo.txt then MSG='GeoIP problem. Could not download country Info' echo "$MSG" >>/var/log/geoip_update.log @@ -281,7 +281,7 @@ function fromGeolite2 { TEMPZIP=$(mktemp) #LICENSE_KEY= GEOLITEURL="https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&license_key=$LICENSE_KEY&suffix=zip" - if ! curl -s $GEOLITEURL > $TEMPZIP + if ! curl -s -L $GEOLITEURL > $TEMPZIP then MSG='GeoIP problem. Unable to download database.' echo "$MSG" >>/var/log/geoip_update.log @@ -319,7 +319,7 @@ function fromGeolite2 { rm $TEMPZIP COUNTRYURL='http://download.geonames.org/export/dump/countryInfo.txt' - if ! curl -s $COUNTRYURL > /tmp/CountryInfo.txt + if ! curl -s -L $COUNTRYURL > /tmp/CountryInfo.txt then MSG='GeoIP problem. Could not download country Info' echo "$MSG" >>/var/log/geoip_update.log