This commit is contained in:
Alexandre
2022-02-18 13:42:06 +01:00
parent 3de9262724
commit 06b78d3573
7 changed files with 17 additions and 17 deletions

View File

@@ -8,7 +8,7 @@ datadirectory=$(bashio::config 'data_directory')
groupmod -o -g "$PGID" abc
usermod -o -u "$PUID" abc
mkdir -p /data/config
mkdir -p $datadirectory
mkdir -p "$datadirectory"
echo '
-------------------------------------
_ ()

View File

@@ -9,8 +9,8 @@ if bashio::config.true 'use_own_certs'; then
#Check if files exist
echo "... checking if referenced files exist"
[ ! -f /ssl/$CERTFILE ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$CERTFILE not found" && bashio::exit.nok
[ ! -f /ssl/$KEYFILE ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$KEYFILE not found" && bashio::exit.nok
[ ! -f /ssl/"$CERTFILE" ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$CERTFILE not found" && bashio::exit.nok
[ ! -f /ssl/"$KEYFILE" ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$KEYFILE not found" && bashio::exit.nok
else
mkdir -p /ssl/nextcloud/keys
@@ -28,7 +28,7 @@ echo "... adding ssl certs in files"
for NGINXFILE in "/defaults/default" "/config/nginx/site-confs/default" "/data/config/nginx/site-confs/default"; do
if [ -f $NGINXFILE ]; then
LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE)
if [ -n $LINE ]; then
if [[ -n "$LINE" ]]; then
sed -i "/ssl_certificate/ d" $NGINXFILE
sed -i "$LINE i ssl_certificate_key /ssl/$KEYFILE;" $NGINXFILE
sed -i "$LINE i ssl_certificate /ssl/$CERTFILE;" $NGINXFILE

View File

@@ -4,14 +4,14 @@
#create folders
datadirectory=$(bashio::config 'data_directory')
mkdir -p \
$datadirectory \
"$datadirectory" \
/data/config/nextcloud/config \
/data/config/nextcloud/data \
/data/config/www/nextcloud/config
#permissions
chown abc:abc \
$datadirectory \
"$datadirectory" \
/data/config/nextcloud/config \
/data/config/nextcloud/data \
/data/config/www/nextcloud/config

View File

@@ -1,4 +1,4 @@
#!/usr/bin/with-contenv bash
#!/usr/bin/with-contenv bashio
# create folders
mkdir -p \

View File

@@ -21,7 +21,7 @@ fi
#################################################################################
if bashio::config.true 'Full_Text_Search'; then
if [ $LAUNCHER fulltextsearch:index ] &>/dev/null; then
if [ $LAUNCHER fulltextsearch:index &>/dev/null ]; then
echo "Full Text Search is already working"
break 2
fi

View File

@@ -13,9 +13,9 @@ if [[ $($LAUNCHER -V) == *"not installed"* ]]; then
fi
# Install OCR if requested
if bashio::config.has_value 'OCR'; then
if [ $(bashio::config 'OCR') = "true" ]; then
# Install package
if $(bashio::config 'OCR') = true; then
if bashio::config.true 'OCR'; then
# Get Full Text Search app for nextcloud
echo "... installing apps : fulltextsearch"
@@ -28,17 +28,17 @@ if bashio::config.has_value 'OCR'; then
if bashio::config.has_value 'OCRLANG'; then
OCRLANG=$(bashio::config 'OCRLANG')
for LANG in $(echo "$OCRLANG" | tr "," " "); do
if [ $LANG != "eng" ]; then
apk add --quiet --no-cache tesseract-ocr-data-$LANG || apk add --quiet --no-cache tesseract-ocr-data-$LANG@community
if [ "$LANG" != "eng" ]; then
apk add --quiet --no-cache tesseract-ocr-data-"$LANG" || apk add --quiet --no-cache tesseract-ocr-data-"$LANG"@community
fi
bashio::log.info "OCR Language installed : $LANG" || bashio::log.fatal "Couldn't install OCR lang $LANG. Please check its format is conform"
# Downloading trainer data
cd /usr/share/tessdata
rm -r $LANG.traineddata &>/dev/null || true
wget https://github.com/tesseract-ocr/tessdata/raw/main/$LANG.traineddata &>/dev/null
cd /usr/share/tessdata || true
rm -r "$LANG".traineddata &>/dev/null || true
wget https://github.com/tesseract-ocr/tessdata/raw/main/"$LANG".traineddata &>/dev/null
done
fi
elif $(bashio::config 'OCR') = false; then
elif [ $(bashio::config 'OCR') = "false" ]; then
bashio::log.info 'Removing OCR'
# Delete package
apk del tesseract-ocr.* &>/dev/null || true

View File

@@ -39,7 +39,7 @@ if bashio::config.has_value 'trusted_domains'; then
bashio::log.info "... alignement with trusted domains list : ${TRUSTEDDOMAINS}"
for domain in ${TRUSTEDDOMAINS//,/ }; do # Comma separated values
bashio::log.info "... adding ${domain}"
$LAUNCHER config:system:set trusted_domains $i --value=${domain}
$LAUNCHER config:system:set trusted_domains $i --value="${domain}"
i=$((i + 1))
done