Validate that the file exists rather than obscure 'Not an elf file' error.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
bdrewery 2016-01-19 22:42:10 +00:00
parent 6a65b1568a
commit ced7888947

View File

@ -29,6 +29,11 @@ while getopts "Uv" flag; do
done
shift $((OPTIND-1))
if ! [ -f "$1" ]; then
echo "No such file or directory: $1" >&2
exit 1
fi
mime=$(file -L --mime-type $1)
isbin=0
case $mime in