]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Updates install script to split + seperated OCR languages to spaces for installation...
authorTrenton Holmes <trenton.holmes@psware.com>
Wed, 20 Apr 2022 20:18:05 +0000 (13:18 -0700)
committerTrenton Holmes <trenton.holmes@psware.com>
Tue, 26 Apr 2022 16:41:08 +0000 (09:41 -0700)
install-paperless-ngx.sh

index 6ffcefbb6686d37077106788729644266813b659..fec14ea8397d5650259309daeb89b15fb0205669 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
 ask() {
        while true ; do
@@ -319,7 +319,10 @@ wget "https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/docker/
 
 SECRET_KEY=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 64 | head -n 1)
 
-DEFAULT_LANGUAGES="deu eng fra ita spa"
+DEFAULT_LANGUAGES=("deu eng fra ita spa")
+
+_split_langs="${OCR_LANGUAGE//+/ }"
+read -r -a OCR_LANGUAGES_ARRAY <<< "${_split_langs}"
 
 {
        if [[ ! $URL == "" ]] ; then
@@ -334,8 +337,8 @@ DEFAULT_LANGUAGES="deu eng fra ita spa"
        echo "PAPERLESS_TIME_ZONE=$TIME_ZONE"
        echo "PAPERLESS_OCR_LANGUAGE=$OCR_LANGUAGE"
        echo "PAPERLESS_SECRET_KEY=$SECRET_KEY"
-       if [[ ! " ${DEFAULT_LANGUAGES[*]} " =~ ${OCR_LANGUAGE} ]] ; then
-               echo "PAPERLESS_OCR_LANGUAGES=$OCR_LANGUAGE"
+       if [[ ! ${DEFAULT_LANGUAGES[*]} =~ ${OCR_LANGUAGES_ARRAY[*]} ]] ; then
+               echo "PAPERLESS_OCR_LANGUAGES=${OCR_LANGUAGES_ARRAY[*]}"
        fi
 } > docker-compose.env