From 03d761b240385f9923a5fd942686acdc2b51fd5b Mon Sep 17 00:00:00 2001 From: Simon L Date: Mon, 2 Jan 2023 16:08:02 +0100 Subject: [PATCH] allow to enable shipped apps during startup Signed-off-by: Simon L --- Containers/nextcloud/entrypoint.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Containers/nextcloud/entrypoint.sh b/Containers/nextcloud/entrypoint.sh index c30c9d43..02bef12a 100644 --- a/Containers/nextcloud/entrypoint.sh +++ b/Containers/nextcloud/entrypoint.sh @@ -263,7 +263,19 @@ if ! [ -f "$NEXTCLOUD_DATA_DIR/skip.update" ]; then if [ -n "$STARTUP_APPS" ]; then read -ra STARTUP_APPS_ARRAY <<< "$STARTUP_APPS" for app in "${STARTUP_APPS_ARRAY[@]}"; do - php /var/www/html/occ app:install "$app" + if ! echo "$app" | grep -q '^-'; then + if [ -z "$(find /var/www/html/apps -type d -maxdepth 1 -mindepth 1 -name "$app" )" ]; then + # If not shipped, install and enable the app + php /var/www/html/occ app:install "$app" + else + # If shipped, enable the app + php /var/www/html/occ app:enable "$app" + fi + else + app="${app#-}" + # Disable the app if '-' was provided in front of the appid + php /var/www/html/occ app:disable "$app" + fi done fi