diff options
author | szaimen <szaimen@e.mail.de> | 2021-05-27 10:54:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-27 10:54:27 +0300 |
commit | c2ea6df9bc002c2d406d61c6e1ac533f2670aec8 (patch) | |
tree | 7c33166548fdad401e302be497a5418a1dc63427 /apps/collabora_integrated.sh | |
parent | 96814404334504ad5c0cef76e2a925dd177aa2d0 (diff) |
make trusted_domain removal and addition its own function (#1990)
Diffstat (limited to 'apps/collabora_integrated.sh')
-rw-r--r-- | apps/collabora_integrated.sh | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/apps/collabora_integrated.sh b/apps/collabora_integrated.sh index 598f0619..82c33b7c 100644 --- a/apps/collabora_integrated.sh +++ b/apps/collabora_integrated.sh @@ -20,6 +20,23 @@ debug_mode # Check if root root_check +# TODO: remove this with NC21.0.3 release +remove_from_trusted_domains() { + local element="$1" + local count=0 + print_text_in_color "$ICyan" "Removing $element from trusted domains..." + while [ "$count" -lt 10 ] + do + if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" = "$element" ] + then + nextcloud_occ_no_check config:system:delete trusted_domains "$count" + break + else + count=$((count+1)) + fi + done +} + # Check if Collabora is installed using the new method if ! is_app_installed richdocumentscode then @@ -64,17 +81,7 @@ We will now remove the old docker and install the app from Nextcloud instead." rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" fi # Remove trusted domain - count=0 - while [ "$count" -lt 10 ] - do - if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ] - then - nextcloud_occ_no_check config:system:delete trusted_domains "$count" - break - else - count=$((count+1)) - fi - done + remove_from_trusted_domains "$SUBDOMAIN" fi # Check if Onlyoffice is installed and remove every trace of it @@ -101,17 +108,7 @@ then rm -f "$SITES_AVAILABLE/$SUBDOMAIN.conf" fi # Remove trusted domain - count=0 - while [ "$count" -lt 10 ] - do - if [ "$(nextcloud_occ_no_check config:system:get trusted_domains "$count")" == "$SUBDOMAIN" ] - then - nextcloud_occ_no_check config:system:delete trusted_domains "$count" - break - else - count=$((count+1)) - fi - done + remove_from_trusted_domains "$SUBDOMAIN" fi # remove OnlyOffice-documentserver if activated |