From 5e89482266b88c6bb175aaa5740572e89163411d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 5 Nov 2021 21:39:51 +0100 Subject: [PATCH] Update 51-ocr --- nextcloud/root/etc/cont-init.d/51-ocr | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nextcloud/root/etc/cont-init.d/51-ocr b/nextcloud/root/etc/cont-init.d/51-ocr index a19675e3d..62f0d58bb 100644 --- a/nextcloud/root/etc/cont-init.d/51-ocr +++ b/nextcloud/root/etc/cont-init.d/51-ocr @@ -1,10 +1,15 @@ #!/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 # Install OCR if requested if bashio::config.has_value 'OCR'; then