Arduino_Tools/linux/dfu-util.sh

24 lines
491 B
Bash
Raw Permalink Normal View History

#!/bin/bash
#
# Use the correct dfu-util program based on the architecture
#
# Get the directory where the script is running.
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
# Choose dfu program by arch
if [ `uname -m` == "x86_64" ]; then
DFU_UTIL=${DIR}/dfu-util_x86_64/dfu-util
else
DFU_UTIL=${DIR}/dfu-util/dfu-util
fi
# Not found!
if [ ! -x "${DFU_UTIL}" ]; then
echo "$0: error: cannot find ${DFU_UTIL}" >&2
exit 2
fi
# Pass all parameters through
"${DFU_UTIL}" "$@"