mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-16 22:01:48 +02:00
Improved code
This commit is contained in:
@@ -1,16 +1,11 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# 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"
|
||||
# Only execute if installed
|
||||
if [ -f /notinstalled ]; then exit 0; fi
|
||||
|
||||
# Make sure there is an Nextcloud installation
|
||||
if [[ $($LAUNCHER -V 2>&1) == *"not installed"* ]]; then
|
||||
echo "... please install first Nextcloud through the webui"
|
||||
exit 0
|
||||
fi
|
||||
# Specify launcher
|
||||
LAUNCHER="sudo -u abc php /data/config/www/nextcloud/occ"
|
||||
|
||||
# Install OCR if requested
|
||||
if [ "$(bashio::config 'OCR')" = "true" ]; then
|
||||
|
||||
Reference in New Issue
Block a user