mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-26 18:43:39 +02:00
Update 91-OCR
This commit is contained in:
@@ -5,15 +5,17 @@ OCRLANG="$(bashio::config "ocrlang")"
|
|||||||
|
|
||||||
if [ -n "$OCRLANG" ]; then
|
if [ -n "$OCRLANG" ]; then
|
||||||
LINE=$(sed -n '/OCR_LANGUAGES/=' /data/config/papermerge.conf.py)
|
LINE=$(sed -n '/OCR_LANGUAGES/=' /data/config/papermerge.conf.py)
|
||||||
echo "OCRLANG variable is set, processing the language packages"
|
bashio::log.info "OCRLANG variable is set, processing the language packages"
|
||||||
|
apt-get update >/dev/null
|
||||||
for i in $(echo "$OCRLANG" | tr "," " "); do
|
for i in $(echo "$OCRLANG" | tr "," " "); do
|
||||||
if apt-cache show tesseract-ocr-"${i}" > /dev/null 2>&1; then
|
if apt-cache show tesseract-ocr-"${i}" > /dev/null 2>&1; then
|
||||||
echo "installing tesseract-ocr-${i}"
|
echo "installing tesseract-ocr-${i}" >/dev/null
|
||||||
apt-get install -y tesseract-ocr-"${i}"
|
apt-get install -y tesseract-ocr-"${i}" >/dev/null
|
||||||
else
|
else
|
||||||
echo "package tesseract-ocr-${i} not found in the repository, skipping"
|
echo "package tesseract-ocr-${i} not found in the repository, skipping"
|
||||||
fi
|
fi
|
||||||
sed "$LINE a \"${i}\": \"${i}\"," products.txt
|
sed "$LINE a \"${i}\": \"${i}\"," /data/config/papermerge.conf.py
|
||||||
LINE=$((LINE+1))
|
LINE=$((LINE+1))
|
||||||
|
bashio::log.info "... ${i} installed"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user