From 3877f83ecc1b26d332e3c78579441b4e0fb5c2e8 Mon Sep 17 00:00:00 2001 From: Glenn Date: Tue, 6 Aug 2024 14:27:34 +0200 Subject: [PATCH] fix: run status before trying to install --- Dockerfile | 2 +- hooks/gx.before-starting.www.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 59908e0..e414e19 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ FROM nextcloud:29.0.3-apache RUN apt-get update \ && apt-get install -y --no-install-recommends \ - clamdscan nano ghostscript \ + clamdscan nano ghostscript jq \ && apt-get clean # diff --git a/hooks/gx.before-starting.www.sh b/hooks/gx.before-starting.www.sh index a1cc0da..8a0f7b1 100755 --- a/hooks/gx.before-starting.www.sh +++ b/hooks/gx.before-starting.www.sh @@ -17,6 +17,13 @@ cd "$WORKDIR" || exit 1 echo "GX:BEFORE-STARTING:START ($(pwd))" # find . -maxdepth 1 +echo "GX:BEFORE-STARTING:STATUS" +INSTALLED="$(php -d memory_limit=-1 occ status |jq -r '.installed')" +if [ "$INSTALLED" != "true" ]; then + echo "WARNING: Not installed yet. Exiting." + exit 0 +fi + echo "GX:BEFORE-STARTING:UPGRADE" php -d memory_limit=-1 occ upgrade echo "GX:BEFORE-STARTING:DB" -- 2.45.2