From be6c0d02b535e564bdae4081af14d8f7308ff404 Mon Sep 17 00:00:00 2001 From: DDATAA <45762540+Ddataa@users.noreply.github.com> Date: Wed, 23 Nov 2022 08:08:57 +0000 Subject: [PATCH] Update upgrade write to ssowat conf.json.persistent to solve trailing slash issue in adding supplementary sandbox domain --- scripts/upgrade | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9a416e2..a553cf3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -186,10 +186,8 @@ if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then # so we use ${sandboxdomain%/} to remove the eccessive trailing slash # it doesnt work # we use jq to correct /etc/ssowat/conf.json uri2=$sandboxdomain - touch /etc/ssowat/tmp.conf.json - cat /etc/ssowat/conf.json | jq --arg uri2 "$uri2" '(.permissions[] | select(.label=="CryptPad") | .uris[1]) |=$uri2' > /etc/ssowat/tmp.conf.json - ynh_secure_remove --file="/etc/ssowat/conf.json" - mv /etc/ssowat/tmp.conf.json /etc/ssowat/conf.json + touch /etc/ssowat/conf.json.persistent + cat /etc/ssowat/conf.json | jq --arg uri2 "$uri2" '(.permissions[] | select(.label=="CryptPad") | .uris[1]) |=$uri2' >> /etc/ssowat/conf.json.persistent fi #=================================================