Update 51-install_options

This commit is contained in:
Alexandre
2021-01-18 15:55:54 +01:00
committed by GitHub
parent 724472609b
commit dc9febf96e

View File

@@ -1,21 +1,17 @@
#!/usr/bin/with-contenv bashio #!/usr/bin/with-contenv bashio
declare CONFIG
declare OCR_LANG
CONFIG=$(</data/options.json)
OCR_LANG=$(bashio::config 'OCR-LANG')
# Install OCR if requested # Install OCR if requested
if [ $(bashio::config 'OCR') = true ]; then if bashio::config.has_value 'OCR'; then
bashio::log.info 'Installing OCR' && \ if $(bashio::config 'OCR') = true; then
bashio::log.info 'Select OCR language from https://github.com/tesseract-ocr/langdata...' && \ bashio::log.info 'Installing OCR' && \
apk add --no-cache \ apk add --no-cache tesseract-ocr \
tesseract-ocr \ elif $(bashio::config 'OCR') = false; then
tesseract-ocr-data-${OCR_LANG} bashio::log.info 'Removing OCR' && \
elif [ $(bashio::config 'OCR') = false ]; then apk del tesseract-ocr.*
bashio::log.info 'Removing OCR' && \ fi
apk del \ # Install additional language if requested
tesseract-ocr \ if bashio::config.has_value 'OCRLANG'; then
tesseract-ocr-data-${OCR_LANG} bashio::log.info 'Installing OCR language' && \
apk add --no-cache tesseract-ocr-data-$(bashio::config 'OCRLANG')
fi
fi fi