mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 12:54:04 +02:00
Improve occ installation detection
This commit is contained in:
@@ -1,10 +1,21 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
#!/usr/bin/with-contenv bashio
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
|
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 [[ $($LAUNCHER -V 2>&1) == *"not installed"* ]]; 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 specific packages
|
# Install specific packages
|
||||||
if [ ! -d /data/config/www/nextcloud/apps/pdfannotate ]; then
|
if [ ! -d /data/config/www/nextcloud/apps/pdfannotate ]; then
|
||||||
CURRENT="$PWD"
|
CURRENT="$PWD"
|
||||||
cd /data/config/www/nextcloud/apps &>/dev/null || exit
|
cd /data/config/www/nextcloud/apps || exit
|
||||||
git clone https://gitlab.com/nextcloud-other/nextcloud-annotate pdfannotate
|
git clone https://gitlab.com/nextcloud-other/nextcloud-annotate pdfannotate
|
||||||
cd "$CURRENT" || exit
|
cd "$CURRENT" || exit
|
||||||
apk add --no-cache ghostscript >/dev/null
|
apk add --no-cache ghostscript >/dev/null
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then
|
|||||||
fi || bashio::log.info "occ not found"
|
fi || bashio::log.info "occ not found"
|
||||||
|
|
||||||
# Make sure there is an Nextcloud installation
|
# Make sure there is an Nextcloud installation
|
||||||
if [[ $($LAUNCHER -V) == *"not installed"* ]]; then
|
if [[ $($LAUNCHER -V 2>&1) == *"not installed"* ]]; then
|
||||||
bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user."
|
bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then
|
|||||||
fi || bashio::log.info "occ not found"
|
fi || bashio::log.info "occ not found"
|
||||||
|
|
||||||
# Make sure there is an Nextcloud installation
|
# Make sure there is an Nextcloud installation
|
||||||
if [[ $($LAUNCHER -V) == *"not installed"* ]]; then
|
if [[ $($LAUNCHER -V 2>&1) == *"not installed"* ]]; then
|
||||||
bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user."
|
bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ if ! bashio::fs.file_exists '/data/config/www/nextcloud/occ'; then
|
|||||||
fi || bashio::log.info "occ not found"
|
fi || bashio::log.info "occ not found"
|
||||||
|
|
||||||
# Make sure there is an Nextcloud installation
|
# Make sure there is an Nextcloud installation
|
||||||
if [[ $($LAUNCHER -V) == *"not installed"* ]]; then
|
if [[ $($LAUNCHER -V 2>&1) == *"not installed"* ]]; then
|
||||||
bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user."
|
bashio::log.warning "It seems there is no Nextcloud server installed. Please restart the addon after initialization of the user."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user