mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-08 08:35:57 +02:00
lint
This commit is contained in:
@@ -8,7 +8,7 @@ datadirectory=$(bashio::config 'data_directory')
|
|||||||
groupmod -o -g "$PGID" abc
|
groupmod -o -g "$PGID" abc
|
||||||
usermod -o -u "$PUID" abc
|
usermod -o -u "$PUID" abc
|
||||||
mkdir -p /data/config
|
mkdir -p /data/config
|
||||||
mkdir -p $datadirectory
|
mkdir -p "$datadirectory"
|
||||||
echo '
|
echo '
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
_ ()
|
_ ()
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ if bashio::config.true 'use_own_certs'; then
|
|||||||
|
|
||||||
#Check if files exist
|
#Check if files exist
|
||||||
echo "... checking if referenced 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/"$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/"$KEYFILE" ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$KEYFILE not found" && bashio::exit.nok
|
||||||
|
|
||||||
else
|
else
|
||||||
mkdir -p /ssl/nextcloud/keys
|
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
|
for NGINXFILE in "/defaults/default" "/config/nginx/site-confs/default" "/data/config/nginx/site-confs/default"; do
|
||||||
if [ -f $NGINXFILE ]; then
|
if [ -f $NGINXFILE ]; then
|
||||||
LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE)
|
LINE=$(sed -n "/ssl_certificate /=" $NGINXFILE)
|
||||||
if [ -n $LINE ]; then
|
if [[ -n "$LINE" ]]; then
|
||||||
sed -i "/ssl_certificate/ d" $NGINXFILE
|
sed -i "/ssl_certificate/ d" $NGINXFILE
|
||||||
sed -i "$LINE i ssl_certificate_key /ssl/$KEYFILE;" $NGINXFILE
|
sed -i "$LINE i ssl_certificate_key /ssl/$KEYFILE;" $NGINXFILE
|
||||||
sed -i "$LINE i ssl_certificate /ssl/$CERTFILE;" $NGINXFILE
|
sed -i "$LINE i ssl_certificate /ssl/$CERTFILE;" $NGINXFILE
|
||||||
|
|||||||
@@ -4,14 +4,14 @@
|
|||||||
#create folders
|
#create folders
|
||||||
datadirectory=$(bashio::config 'data_directory')
|
datadirectory=$(bashio::config 'data_directory')
|
||||||
mkdir -p \
|
mkdir -p \
|
||||||
$datadirectory \
|
"$datadirectory" \
|
||||||
/data/config/nextcloud/config \
|
/data/config/nextcloud/config \
|
||||||
/data/config/nextcloud/data \
|
/data/config/nextcloud/data \
|
||||||
/data/config/www/nextcloud/config
|
/data/config/www/nextcloud/config
|
||||||
|
|
||||||
#permissions
|
#permissions
|
||||||
chown abc:abc \
|
chown abc:abc \
|
||||||
$datadirectory \
|
"$datadirectory" \
|
||||||
/data/config/nextcloud/config \
|
/data/config/nextcloud/config \
|
||||||
/data/config/nextcloud/data \
|
/data/config/nextcloud/data \
|
||||||
/data/config/www/nextcloud/config
|
/data/config/www/nextcloud/config
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bashio
|
||||||
|
|
||||||
# create folders
|
# create folders
|
||||||
mkdir -p \
|
mkdir -p \
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ fi
|
|||||||
#################################################################################
|
#################################################################################
|
||||||
|
|
||||||
if bashio::config.true 'Full_Text_Search'; then
|
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"
|
echo "Full Text Search is already working"
|
||||||
break 2
|
break 2
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ if [[ $($LAUNCHER -V) == *"not installed"* ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Install OCR if requested
|
# Install OCR if requested
|
||||||
if bashio::config.has_value 'OCR'; then
|
if [ $(bashio::config 'OCR') = "true" ]; then
|
||||||
# Install package
|
# Install package
|
||||||
if $(bashio::config 'OCR') = true; then
|
if bashio::config.true 'OCR'; then
|
||||||
|
|
||||||
# Get Full Text Search app for nextcloud
|
# Get Full Text Search app for nextcloud
|
||||||
echo "... installing apps : fulltextsearch"
|
echo "... installing apps : fulltextsearch"
|
||||||
@@ -28,17 +28,17 @@ if bashio::config.has_value 'OCR'; then
|
|||||||
if bashio::config.has_value 'OCRLANG'; then
|
if bashio::config.has_value 'OCRLANG'; then
|
||||||
OCRLANG=$(bashio::config 'OCRLANG')
|
OCRLANG=$(bashio::config 'OCRLANG')
|
||||||
for LANG in $(echo "$OCRLANG" | tr "," " "); do
|
for LANG in $(echo "$OCRLANG" | tr "," " "); do
|
||||||
if [ $LANG != "eng" ]; then
|
if [ "$LANG" != "eng" ]; then
|
||||||
apk add --quiet --no-cache tesseract-ocr-data-$LANG || apk add --quiet --no-cache tesseract-ocr-data-$LANG@community
|
apk add --quiet --no-cache tesseract-ocr-data-"$LANG" || apk add --quiet --no-cache tesseract-ocr-data-"$LANG"@community
|
||||||
fi
|
fi
|
||||||
bashio::log.info "OCR Language installed : $LANG" || bashio::log.fatal "Couldn't install OCR lang $LANG. Please check its format is conform"
|
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
|
# Downloading trainer data
|
||||||
cd /usr/share/tessdata
|
cd /usr/share/tessdata || true
|
||||||
rm -r $LANG.traineddata &>/dev/null || true
|
rm -r "$LANG".traineddata &>/dev/null || true
|
||||||
wget https://github.com/tesseract-ocr/tessdata/raw/main/$LANG.traineddata &>/dev/null
|
wget https://github.com/tesseract-ocr/tessdata/raw/main/"$LANG".traineddata &>/dev/null
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
elif $(bashio::config 'OCR') = false; then
|
elif [ $(bashio::config 'OCR') = "false" ]; then
|
||||||
bashio::log.info 'Removing OCR'
|
bashio::log.info 'Removing OCR'
|
||||||
# Delete package
|
# Delete package
|
||||||
apk del tesseract-ocr.* &>/dev/null || true
|
apk del tesseract-ocr.* &>/dev/null || true
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ if bashio::config.has_value 'trusted_domains'; then
|
|||||||
bashio::log.info "... alignement with trusted domains list : ${TRUSTEDDOMAINS}"
|
bashio::log.info "... alignement with trusted domains list : ${TRUSTEDDOMAINS}"
|
||||||
for domain in ${TRUSTEDDOMAINS//,/ }; do # Comma separated values
|
for domain in ${TRUSTEDDOMAINS//,/ }; do # Comma separated values
|
||||||
bashio::log.info "... adding ${domain}"
|
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))
|
i=$((i + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user