mirror of
https://github.com/luzifer-docker/matomo.git
synced 2024-12-21 04:11:17 +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
|