From 9b0c1e3f3abc7cd8a8e27b568b5b0ef61b332e28 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 2 Dec 2019 16:14:30 +0100 Subject: [PATCH] fix: [nextcloud] detect correctly previously declared trusted domain This will prevent also to have a new trusted domain being added at each relation-joined time. Signed-off-by: Valentin Lab --- nextcloud/hooks/web_proxy-relation-joined | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextcloud/hooks/web_proxy-relation-joined b/nextcloud/hooks/web_proxy-relation-joined index aa899b3..135df04 100755 --- a/nextcloud/hooks/web_proxy-relation-joined +++ b/nextcloud/hooks/web_proxy-relation-joined @@ -18,7 +18,7 @@ occ_opts=( config:system:set overwritehost --value="$DOMAIN" \; config:system:set overwriteprotocol --value="$PROTO" ) -if ! [[ "$'\n'$trusted_domains$'\n'" == *"$'\n'$MASTER_BASE_SERVICE_NAME$'\n'"* ]]; then +if ! [[ $'\n'"$trusted_domains"$'\n' == *$'\n'"$MASTER_BASE_SERVICE_NAME"$'\n'* ]]; then trusted_index=$(echo "$trusted_domains" | wc -l) debug "Adding $MASTER_TARGET_SERVICE_NAME to ${WHITE}trusted_domains${NORMAL}." occ_opts+=( \; config:system:set trusted_domains "$trusted_index" --value="$MASTER_BASE_SERVICE_NAME")