diff --git a/fax.sh b/fax.sh index 5bca8e7..5059168 100755 --- a/fax.sh +++ b/fax.sh @@ -57,6 +57,11 @@ echo -n "Sending file ${FILE} " REC=$(echo "$REC0" | sed -e 's:[^+0-9]::g' -e 's:^0\([1-9]\):+49\1:') echo "to $REC" #Checking for file size: +if [ ! -e $FILE ] +then + echo "File not found" + exit 2 +fi SIZE=$(stat -c%s "$FILE") if [ $SIZE -gt 10485760 ] then @@ -65,7 +70,7 @@ then fi if hash gs 2>/dev/null then - PAGES=$(gs -q -dNODISPLAY -c "($FILE) (r) file runpdfbegin pdfpagecount = quit" 2>&1) + PAGES=$(gs -q -dNODISPLAY -dNOSAFER -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"