From f0970baeaf17728cef72a9c60bf18ff978fa7619 Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Sun, 22 Sep 2024 21:01:37 +0200 Subject: [PATCH 1/8] Update scantofile-0.2.4-1.sh added removal on non-OCR file --- script/scantofile-0.2.4-1.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script/scantofile-0.2.4-1.sh b/script/scantofile-0.2.4-1.sh index 3a4cdf8..4b8e744 100755 --- a/script/scantofile-0.2.4-1.sh +++ b/script/scantofile-0.2.4-1.sh @@ -88,7 +88,15 @@ "${FTP_PASSWORD}" \ "${FTP_HOST}" \ "${FTP_PATH}" \ +<<<<<<< HEAD "/scans/${date}-ocr.pdf" +======= + "${output_pdf_file}" + + if [ -n "${REMOVE_ORIGINAL_AFTER_OCR}" ]; then + rm ${output_pdf_file} + fi +>>>>>>> Update scantofile-0.2.4-1.sh ) & fi ) & From ec11da5304b37ee3c1cb2fbf832bc1ae6942e8ed Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Sun, 22 Sep 2024 21:02:11 +0200 Subject: [PATCH 2/8] Update scanRear.sh remove original after OCR --- script/scanRear.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/script/scanRear.sh b/script/scanRear.sh index eb3e40f..40e0d36 100755 --- a/script/scanRear.sh +++ b/script/scanRear.sh @@ -113,7 +113,15 @@ fi "${FTP_PASSWORD}" \ "${FTP_HOST}" \ "${FTP_PATH}" \ +<<<<<<< HEAD "/scans/${date}-ocr.pdf" +======= + "${output_pdf_file}" + + if [ -n "${REMOVE_ORIGINAL_AFTER_OCR}" ]; then + rm ${output_pdf_file} + fi +>>>>>>> Update scanRear.sh ) & fi ) & From 40dc0261aaf9648d636f4709c23aadca6d9abe66 Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Sun, 22 Sep 2024 21:03:57 +0200 Subject: [PATCH 3/8] Update README.md added description of REMOVE_ORIGINAL_AFTER_OCR --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 20846a8..661e13b 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,7 @@ You can configure the tool via environment variables: | IPADDRESS | mandatory | IP Address of your scanner | | RESOLUTION | optional | DPI resolution of scan, refer to capabilities of printer on startup | | REMOVE_BLANK_THRESHOLD | optional | Percentage of content in page until which a page is considered blank. A good default is 0.3. Blank pages are removed if this variable is defined | +| REMOVE_ORIGINAL_AFTER_OCR | optional | Deletes the original scan, once OCR file is saved (default: false) | | FTP_USER | optional | Username of an FTP(S) server to upload the completed scan to (see below) | | FTP_PASSWORD | optional | Username of an FTP(S) server to upload the completed scan to (see below) | | FTP_HOST | optional | Address of an FTP(S) server to upload the completed scan to (see below) | From 7a11b4eb40464e18f1ded1735749093a362af396 Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Sun, 22 Sep 2024 21:06:05 +0200 Subject: [PATCH 4/8] Update scantofile-0.2.4-1.sh handled setting values to false --- script/scantofile-0.2.4-1.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/scantofile-0.2.4-1.sh b/script/scantofile-0.2.4-1.sh index 4b8e744..ac56b3e 100755 --- a/script/scantofile-0.2.4-1.sh +++ b/script/scantofile-0.2.4-1.sh @@ -93,7 +93,7 @@ ======= "${output_pdf_file}" - if [ -n "${REMOVE_ORIGINAL_AFTER_OCR}" ]; then + if [ "${REMOVE_ORIGINAL_AFTER_OCR}" = true ]; then rm ${output_pdf_file} fi >>>>>>> Update scantofile-0.2.4-1.sh From 9a6f99d1b70e02eadcb78cf797575f38d5d273fe Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Sun, 22 Sep 2024 21:06:23 +0200 Subject: [PATCH 5/8] Update scanRear.sh handled setting values to false --- script/scanRear.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/scanRear.sh b/script/scanRear.sh index 40e0d36..5883682 100755 --- a/script/scanRear.sh +++ b/script/scanRear.sh @@ -118,7 +118,7 @@ fi ======= "${output_pdf_file}" - if [ -n "${REMOVE_ORIGINAL_AFTER_OCR}" ]; then + if [ "${REMOVE_ORIGINAL_AFTER_OCR}" = true ]; then rm ${output_pdf_file} fi >>>>>>> Update scanRear.sh From 8a20c5f28a21a5b2b84efb6b7d13135389acd7c2 Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Mon, 23 Sep 2024 20:08:45 +0200 Subject: [PATCH 6/8] added check for existance of OCR pdf --- script/scanRear.sh | 4 +++- script/scantofile-0.2.4-1.sh | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/script/scanRear.sh b/script/scanRear.sh index 5883682..5888ef0 100755 --- a/script/scanRear.sh +++ b/script/scanRear.sh @@ -119,7 +119,9 @@ fi "${output_pdf_file}" if [ "${REMOVE_ORIGINAL_AFTER_OCR}" = true ]; then - rm ${output_pdf_file} + if [ -f "/scans/${date}-ocr.pdf" ]; then + rm ${output_pdf_file} + fi fi >>>>>>> Update scanRear.sh ) & diff --git a/script/scantofile-0.2.4-1.sh b/script/scantofile-0.2.4-1.sh index ac56b3e..6d6604a 100755 --- a/script/scantofile-0.2.4-1.sh +++ b/script/scantofile-0.2.4-1.sh @@ -94,7 +94,9 @@ "${output_pdf_file}" if [ "${REMOVE_ORIGINAL_AFTER_OCR}" = true ]; then - rm ${output_pdf_file} + if [ -f "/scans/${date}-ocr.pdf" ]; then + rm ${output_pdf_file} + fi fi >>>>>>> Update scantofile-0.2.4-1.sh ) & From 9e47f4438a17c71b7ee8c93b81e6b16b1de5cbb9 Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Mon, 23 Sep 2024 20:25:08 +0200 Subject: [PATCH 7/8] fixed rebase --- script/scanRear.sh | 4 ---- script/scantofile-0.2.4-1.sh | 4 ---- 2 files changed, 8 deletions(-) diff --git a/script/scanRear.sh b/script/scanRear.sh index 5888ef0..93a79a4 100755 --- a/script/scanRear.sh +++ b/script/scanRear.sh @@ -113,17 +113,13 @@ fi "${FTP_PASSWORD}" \ "${FTP_HOST}" \ "${FTP_PATH}" \ -<<<<<<< HEAD "/scans/${date}-ocr.pdf" -======= - "${output_pdf_file}" if [ "${REMOVE_ORIGINAL_AFTER_OCR}" = true ]; then if [ -f "/scans/${date}-ocr.pdf" ]; then rm ${output_pdf_file} fi fi ->>>>>>> Update scanRear.sh ) & fi ) & diff --git a/script/scantofile-0.2.4-1.sh b/script/scantofile-0.2.4-1.sh index 6d6604a..4d04e6e 100755 --- a/script/scantofile-0.2.4-1.sh +++ b/script/scantofile-0.2.4-1.sh @@ -88,17 +88,13 @@ "${FTP_PASSWORD}" \ "${FTP_HOST}" \ "${FTP_PATH}" \ -<<<<<<< HEAD "/scans/${date}-ocr.pdf" -======= - "${output_pdf_file}" if [ "${REMOVE_ORIGINAL_AFTER_OCR}" = true ]; then if [ -f "/scans/${date}-ocr.pdf" ]; then rm ${output_pdf_file} fi fi ->>>>>>> Update scantofile-0.2.4-1.sh ) & fi ) & From 3e4424d00519bbf63d221df5a2200b20d4d83e2f Mon Sep 17 00:00:00 2001 From: Philipp Mundhenk Date: Mon, 23 Sep 2024 20:25:44 +0200 Subject: [PATCH 8/8] fixed env comparison --- script/scanRear.sh | 2 +- script/scantofile-0.2.4-1.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/scanRear.sh b/script/scanRear.sh index 93a79a4..3fa0180 100755 --- a/script/scanRear.sh +++ b/script/scanRear.sh @@ -115,7 +115,7 @@ fi "${FTP_PATH}" \ "/scans/${date}-ocr.pdf" - if [ "${REMOVE_ORIGINAL_AFTER_OCR}" = true ]; then + if [ "${REMOVE_ORIGINAL_AFTER_OCR}" == "true" ]; then if [ -f "/scans/${date}-ocr.pdf" ]; then rm ${output_pdf_file} fi diff --git a/script/scantofile-0.2.4-1.sh b/script/scantofile-0.2.4-1.sh index 4d04e6e..4e8c770 100755 --- a/script/scantofile-0.2.4-1.sh +++ b/script/scantofile-0.2.4-1.sh @@ -90,7 +90,7 @@ "${FTP_PATH}" \ "/scans/${date}-ocr.pdf" - if [ "${REMOVE_ORIGINAL_AFTER_OCR}" = true ]; then + if [ "${REMOVE_ORIGINAL_AFTER_OCR}" == "true" ]; then if [ -f "/scans/${date}-ocr.pdf" ]; then rm ${output_pdf_file} fi