From 7bdd51554aaea7d890e91f1b5020c6d059f3c533 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Mon, 10 Jun 2024 10:24:30 +0200 Subject: [PATCH 1/2] nextcloud: improve getting values for APPSTORAGE Signed-off-by: Simon L --- Containers/nextcloud/entrypoint.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index c1945e54..70ae4bc2 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -162,8 +162,13 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then declare -Ag APPSTORAGE echo "Disabling apps before the update in order to make the update procedure more safe. This can take a while..." for app in "${NC_APPS_ARRAY[@]}"; do - APPSTORAGE[$app]=$(php /var/www/html/occ config:app:get "$app" enabled) - php /var/www/html/occ app:disable "$app" + if php /var/www/html/occ config:app:get "$app" enabled >/dev/null; then + APPSTORAGE[$app]="$(php /var/www/html/occ config:app:get "$app" enabled)" + php /var/www/html/occ app:disable "$app" + else + APPSTORAGE[$app]="" + echo "Not disabling $app because the occ command to get the enabled state was failing." + fi done fi From 7c97d6657973accbc45ade86cfe65733d3672ddd Mon Sep 17 00:00:00 2001 From: Simon L Date: Tue, 11 Jun 2024 10:38:38 +0200 Subject: [PATCH 2/2] address review Signed-off-by: Simon L Co-authored-by: Josh Signed-off-by: Simon L. --- Containers/nextcloud/entrypoint.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index 70ae4bc2..eaa78778 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -162,8 +162,7 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then declare -Ag APPSTORAGE echo "Disabling apps before the update in order to make the update procedure more safe. This can take a while..." for app in "${NC_APPS_ARRAY[@]}"; do - if php /var/www/html/occ config:app:get "$app" enabled >/dev/null; then - APPSTORAGE[$app]="$(php /var/www/html/occ config:app:get "$app" enabled)" + if APPSTORAGE[$app]="$(php /var/www/html/occ config:app:get "$app" enabled)"; then php /var/www/html/occ app:disable "$app" else APPSTORAGE[$app]=""