2019-06-09 10:40:37 +00:00
|
|
|
#!/usr/bin/with-contenv /bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2019-06-09 18:26:41 +00:00
|
|
|
echo "Checking for Matomo update..."
|
2019-06-09 10:40:37 +00:00
|
|
|
if [[ -f core/Version.php ]]; then
|
|
|
|
installed_version=$(grep VERSION core/Version.php | sed -E "s/.*'(.*)'.*/\\1/")
|
|
|
|
if [ -n "${installed_version}" ] && [[ ${installed_version} == ${MATOMO_VERSION} ]]; then
|
2019-06-09 18:26:41 +00:00
|
|
|
echo "- Matomo installation is up-to-date." >&2
|
2019-06-09 10:40:37 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "No Matomo installation found or not up-to-date" >&2
|
|
|
|
echo "Installing bundled Matomo version" >&2
|
|
|
|
|
|
|
|
tar -xvz -C /var/www --strip-components=1 -f /opt/matomo.tgz
|
|
|
|
chown -R nobody:nogroup /var/www
|