From 3270066e7d42b7a6f9c50a892dd47e63f3314d12 Mon Sep 17 00:00:00 2001 From: DanielsLPecke Date: Mon, 14 Nov 2016 13:42:03 +0100 Subject: Drop local_pdffile function, don't reference unused PDF_FILE variable anymore. --- bin/impressive-display | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/bin/impressive-display b/bin/impressive-display index ac07681..2186d29 100755 --- a/bin/impressive-display +++ b/bin/impressive-display @@ -257,20 +257,6 @@ function merge_portrait_documents { } -function local_pdffile { - - cp $PDF_FILE $workdir/$(basename $PDF_FILE) - - # is the PDF file gzipped? - if echo $(basename $PDF_FILE) | grep -E ".*\.gz"; then - PDF_FILE=${PDF_FILE/.gz/} - gunzip $workdir/$(basename $PDF_FILE).gz - fi - mv $workdir/$(basename $PDF_FILE) "$pdffile_downloaded" - - merge_portrait_documents - -} function is_rush_hour { @@ -340,8 +326,13 @@ function download_pdffile { fi curl $creds "$PDF_URI" 1> "$pdffile_downloaded" 2>/dev/null - if pdfinfo "$pdffile_downloaded" 1>/dev/null 2>/dev/null; then + # is the PDF file gzipped? + if echo $(basename $pdffile_downloaded) | grep -E ".*\.gz"; then + pdffile_downloaded=${pdffile_downloaded/.gz/} + gunzip $workdir/$(basename $pdffile_downloaded).gz + fi + if pdfinfo "$pdffile_downloaded" 1>/dev/null 2>/dev/null; then merge_portrait_documents cmp -s "$pdffile_downloaded" "$pdffile_previous"> /dev/null @@ -456,12 +447,6 @@ if [ -n "$PDF_URI" ]; then create_lock download_loop -elif [ -n "$PDF_FILE" ]; then - - $OUTPUT "INFO: PDF_FILE is configured. Using local PDF file: $PDF_FILE" - create_lock - local_pdffile - else $OUTPUT "ERROR: PDF_URI hasn't been configured. Doing nothing." -- cgit v1.2.3