From f5753c590fb5ba037a9708c743625014e945358c Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 5 Nov 2021 21:40:24 +0100 Subject: [PATCH] Update 61-trusted_domains --- .../root/etc/cont-init.d/61-trusted_domains | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/nextcloud/root/etc/cont-init.d/61-trusted_domains b/nextcloud/root/etc/cont-init.d/61-trusted_domains index e074191e4..a71bdedd1 100644 --- a/nextcloud/root/etc/cont-init.d/61-trusted_domains +++ b/nextcloud/root/etc/cont-init.d/61-trusted_domains @@ -1,21 +1,22 @@ #!/usr/bin/with-contenv bashio +LAUNCHER="sudo -u abc php /data/config/www/nextcloud/occ" || bashio::log.info "/data/config/www/nextcloud/occ not found" + if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then + LAUNCHER=$(find / -name "occ" -print -quit) + fi || bashio::log.info "occ not found" + # Make sure there is an Nextcloud installation -#if ! [ "$(nextcloud_occ -V)" ]; then -# bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user." -# exit 0 -#fi +if ! [ "$($LAUNCHER -V)" ]; then + bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user." + exit 0 +fi #################### # Initialization # #################### if bashio::config.has_value 'trusted_domains'; then - LAUNCHER="sudo -u abc php /data/config/www/nextcloud/occ" || bashio::log.info "/data/config/www/nextcloud/occ not found" - if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then - LAUNCHER=$(find / -name "occ" -print -quit) - fi || bashio::log.info "occ not found" - + bashio::log.info "Currently set trusted domains :" $LAUNCHER config:system:get trusted_domains || bashio::log.info "No trusted domain set yet. The first one will be set when doing initial configuration"