#!/bin/bash

if test $# != 1; then
    die "Error: Usage $(basename $0) BMP-FILE"
fi

if ! echo "$@" | grep / -q; then
    set -- /data/"$1"
fi

if test "$(dirname "$@")" != /data; then
    die "You can only capture a bmp file in the /data folder"
fi

if ! echo "${1##*.}" |grep -i bmp; then
    die "Can only dump to a .bmp file, ${1} is not .bmp file"
fi

fb2bmp "$@"
