diff options
author | DanielsLPecke <daniel.letsplay007@gmail.com> | 2016-11-14 13:42:03 +0100 |
---|---|---|
committer | DanielsLPecke <daniel.letsplay007@gmail.com> | 2016-11-14 13:46:27 +0100 |
commit | 467b06979bb3fbca3b7e0cf981a9be6a79e6e1aa (patch) | |
tree | c9ab4c5210fc434b743146c17a20ad597150c72d | |
parent | 2bb7f687a4a0c37acda111fee8cb76147abfa64c (diff) | |
download | impressive-display-467b06979bb3fbca3b7e0cf981a9be6a79e6e1aa.tar.gz impressive-display-467b06979bb3fbca3b7e0cf981a9be6a79e6e1aa.tar.bz2 impressive-display-467b06979bb3fbca3b7e0cf981a9be6a79e6e1aa.zip |
rebase: clean local_pdffile function
-rwxr-xr-x | bin/impressive-display | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/bin/impressive-display b/bin/impressive-display index e0b243d..d7a8720 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,15 +447,9 @@ 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: Neither PDF_FILE nor PDF_URI has been configured. Doing nothing. Maybe you're using Dash instead of Bash?" + $OUTPUT "ERROR: PDF_URI hasn't been configured. Doing nothing. Maybe you're using Dash instead of Bash?" exit 0 fi |