split_card script: added syntaxe checking

This commit is contained in:
Goffi 2010-06-18 17:14:14 +08:00
commit 5e0a757a1b

View file

@ -49,6 +49,22 @@ then
exit 1
fi
SYNTAXE="Split card image\nsyntaxe: $0 jpeg_image_to_split.jpg"
if [ $# -ne 1 ]
then
echo $SYNTAXE
exit 1
fi
echo `file -b --mime-type $1` | grep image 2>&1 > /dev/null
if [ $? -ne 0 ]
then
echo "target file is not an image"
exit 1
fi
current=`pwd`
#TODO: check directory presence
#echo "making directory"