diff --git a/scripts/install b/scripts/install index 4fc97a4..6c7ab56 100644 --- a/scripts/install +++ b/scripts/install @@ -185,6 +185,7 @@ if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then ynh_permission_url --permission="main" --add_url=$sandboxdomain --auth_header=true # there is a bug in core that add a slash at the end of domain in ssowat conf for uris var # so we use ${sandboxdomain%/} to remove the eccessive trailing slash # it doesnt work + # we use jq to correct /etc/ssowat/conf.json uri1=$domain uri2=$sandboxdomain @@ -192,8 +193,9 @@ if ! [ ${PACKAGE_CHECK_EXEC:-0} -eq 1 ]; then cat /etc/ssowat/conf.json | jq 'del(.permissions[] | select(.label=="CryptPad") | .uris)' #we write them again cat /etc/ssowat/conf.json | jq --arg uri1 "$uri1" '(.permissions[] | select(.label=="CryptPad") | .uris[0]) |=$uri1' - cat /etc/ssowat/conf.json | jq --arg uri2 "$uri2" '(.permissions[] | select(.label=="CryptPad") | .uris[1]) |=$uri2' - + cat /etc/ssowat/conf.json | jq --arg uri2 "$uri2" '(.permissions[] | select(.label=="CryptPad") | .uris[1]) |=$uri2' > /etc/ssowat/tmp.conf.json + rm /etc/ssowat/conf.json + mv /etc/ssowat/tmp.conf.json /etc/ssowat/conf.json fi #=================================================