From e4f416635da85e366d427bdacfc8bc3438983a6b Mon Sep 17 00:00:00 2001
From: Arie Peterson <arie@greenhost.nl>
Date: Wed, 21 Aug 2024 11:27:38 +0200
Subject: [PATCH] Deal with warning when setting cron mode

---
 templates/setup-apps-configmap.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/templates/setup-apps-configmap.yaml b/templates/setup-apps-configmap.yaml
index 135561b5..aa8ef7c8 100644
--- a/templates/setup-apps-configmap.yaml
+++ b/templates/setup-apps-configmap.yaml
@@ -164,7 +164,9 @@ data:
     run_as "php $occ config:import /var/local/config.json"
     # We used to set this in `config.json` too, but ran into a nextcloud bug:
     # https://github.com/nextcloud/server/issues/45083
-    run_as "php $occ config:app:set --value webcron --type string core backgroundjobs_mode"
+    # The `echo "yes"` is necessary because in some cases nextcloud will warn
+    # about the string type and ask for confirmation.
+    echo "yes" | run_as "php $occ config:app:set --value webcron --type string core backgroundjobs_mode"
 
     echo "Updating database indices, columns, keys, etc."
     run_as "php $occ db:add-missing-indices --no-interaction"
-- 
GitLab