Arduino_Tools/linux/dfu-util.sh
Jeremy Gillick 201e809c72 [linux] Create dfu-util script to select correct program (32/64-bit) (#46)
* Add dfu-util script to use correct arch program.

* Add i386 binaries from official distribution.
2019-12-19 17:39:49 +01:00

23 lines
491 B
Bash
Executable file

#!/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}" "$@"