scripts/pdfresize: Fix input checks

master
Pierre Neidhardt 2015-12-06 15:33:52 +11:00
parent 82ec7f0bd2
commit e426e65a5c
1 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,12 @@ fi
if [ ! -f "$1" ]; then
echo "$1 is not a valid file."
exit
fi
if [ -e "$2" ]; then
echo "$2 exists."
exit
fi
gs -q -o "$2" -sDEVICE=pdfwrite -sPAPERSIZE=a4 -dFIXEDMEDIA -dPDFFitPage -dCompatibilityLevel=1.4 "$1"