mirror of
https://github.com/luzifer-docker/matomo.git
synced 2024-12-30 08:41:15 +00:00
12 lines
461 B
Bash
Executable file
12 lines
461 B
Bash
Executable file
#!/usr/bin/with-contenv /bin/bash
|
|
set -euo pipefail
|
|
|
|
geoip_timeout=604800
|
|
|
|
echo "Checking GeoIP database..."
|
|
if [[ ! -f misc/GeoLite2-City.mmdb ]] || [[ $(($(date +%s) - $(stat -c %Z misc/GeoLite2-City.mmdb))) -gt ${geoip_timeout} ]]; then
|
|
curl -sSfL "https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz" |
|
|
tar -xz -C misc --strip-components=1 --wildcards '*/GeoLite2-City.mmdb'
|
|
fi
|
|
|
|
chown nobody:nogroup /var/www/misc/GeoLite2-City.mmdb
|