diff --git a/fax.sh b/fax.sh index 4c92a3e..5bca8e7 100755 --- a/fax.sh +++ b/fax.sh @@ -65,7 +65,8 @@ then fi if hash gs 2>/dev/null then - if [ $(gs -q -dNODISPLAY -c "(fax.pdf) (r) file runpdfbegin pdfpagecount = quit" 2>&1) -gt 30 ] + PAGES=$(gs -q -dNODISPLAY -c "($FILE) (r) file runpdfbegin pdfpagecount = quit" 2>&1) + if [ $PAGES -gt 30 ] then echo "Sipgate won't send your file, because it has more than 30 pages" exit 2