Skip to content

Commit

Permalink
Follow redirects on curl requests. Fixes downloading Maxmind Geolite …
Browse files Browse the repository at this point in the history
…since they changed behaviour on January 2024
  • Loading branch information
asternic committed May 10, 2024
1 parent 82be5bc commit e8c7620
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build/4.0/files/geoip_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e8c7620

Please sign in to comment.