Add compatibility with gs>=9.50

callerid
Gandalf 2021-04-19 13:55:36 +02:00
parent bee8aa182c
commit e73d37470d
1 changed files with 6 additions and 1 deletions

7
fax.sh
View File

@ -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"