mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-10 16:01:00 +02:00
fixed End Of Line Sequence
This commit is contained in:
20
papermerge/rootfs/etc/cont-init.d/91-OCR.sh
Normal file
20
papermerge/rootfs/etc/cont-init.d/91-OCR.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
# Allow OCR setting
|
||||
OCRLANG="$(bashio::config "ocrlang")"
|
||||
|
||||
if [ -n "$OCRLANG" ]; then
|
||||
LINE=$(sed -n '/OCR_LANGUAGES/=' /data/config/papermerge.conf.py)
|
||||
bashio::log.info "OCRLANG variable is set, processing the language packages"
|
||||
apt-get update >/dev/null
|
||||
for i in $(echo "$OCRLANG" | tr "," " "); do
|
||||
if apt-cache show tesseract-ocr-"${i}" >/dev/null 2>&1; then
|
||||
echo "installing tesseract-ocr-${i}" >/dev/null
|
||||
apt-get install -yqq tesseract-ocr-"${i}" >/dev/null
|
||||
else
|
||||
echo "package tesseract-ocr-${i} not found in the repository, skipping"
|
||||
fi
|
||||
sed -i "$LINE a \"${i}\": \"${i}\"," /data/config/papermerge.conf.py
|
||||
bashio::log.info "... ${i} installed"
|
||||
done
|
||||
fi
|
||||
Reference in New Issue
Block a user