Skip to content
Snippets Groups Projects

Fix MaxMind database downloads post-CCPA update #8

Merged Martin Lowe requested to merge github/fork/autumnfound/malowe/master/8 into master
3 files
+ 15
8
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 11
5
@@ -23,14 +23,21 @@ if [ -z "${1}" ]; then
exit 1
fi
## retrieve license key
LICENSE_KEY=$(cat /run/secrets/license_key)
if [ -z "$LICENSE_KEY" ]; then
echo "Could not find a license key in /run/secrets"
exit 1
fi
mkdir -p "${1}/bin"
mkdir -p "${1}/db"
pushd "${1:-"."}" || exit 1
echo "Getting data from MaxMind"
curl -sSL "https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz" | tar zxv -C bin --wildcards '*.mmdb'
curl -sSL "https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz" | tar zxv -C bin --wildcards '*.mmdb'
curl -sSL "https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip" -o GeoLite2-Country-CSV.zip
curl -sSL "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&suffix=tar.gz&license_key=$LICENSE_KEY" | tar zxv -C bin --wildcards '*.mmdb'
curl -sSL "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&suffix=tar.gz&license_key=$LICENSE_KEY" | tar zxv -C bin --wildcards '*.mmdb'
curl -sSL "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country-CSV&suffix=zip&license_key=$LICENSE_KEY" -o GeoLite2-Country-CSV.zip
unzip GeoLite2-Country-CSV.zip
rm -vf GeoLite2-Country-CSV.zip
@@ -46,4 +53,4 @@ mv -vf bin/GeoLite2-**/GeoLite2-C*.mmdb bin/
rm -rvf bin/GeoLite2-City_*
rm -rvf bin/GeoLite2-Country_*
popd || exit 1
\ No newline at end of file
popd || exit 1
Loading