Add compatibility with gs>=9.50
This commit is contained in:
parent
bee8aa182c
commit
e73d37470d
7
fax.sh
7
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:')
|
REC=$(echo "$REC0" | sed -e 's:[^+0-9]::g' -e 's:^0\([1-9]\):+49\1:')
|
||||||
echo "to $REC"
|
echo "to $REC"
|
||||||
#Checking for file size:
|
#Checking for file size:
|
||||||
|
if [ ! -e $FILE ]
|
||||||
|
then
|
||||||
|
echo "File not found"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
SIZE=$(stat -c%s "$FILE")
|
SIZE=$(stat -c%s "$FILE")
|
||||||
if [ $SIZE -gt 10485760 ]
|
if [ $SIZE -gt 10485760 ]
|
||||||
then
|
then
|
||||||
|
@ -65,7 +70,7 @@ then
|
||||||
fi
|
fi
|
||||||
if hash gs 2>/dev/null
|
if hash gs 2>/dev/null
|
||||||
then
|
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 ]
|
if [ $PAGES -gt 30 ]
|
||||||
then
|
then
|
||||||
echo "Sipgate won't send your file, because it has more than 30 pages"
|
echo "Sipgate won't send your file, because it has more than 30 pages"
|
||||||
|
|
Loading…
Reference in a new issue