mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-20 07:41:48 +02:00
Update 51-install_options
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user