1
0
forked from me/IronOS

Merge pull request #775 from HanaO00/patch-2

Update flash_ts100_linux.sh
This commit is contained in:
Ben V. Brown
2021-01-07 09:06:03 +11:00
committed by GitHub

View File

@@ -13,13 +13,13 @@ function usage() {
echo echo
echo "This script has been tested to work on Fedora." echo "This script has been tested to work on Fedora."
echo "If you experience any issues please open a ticket at:" echo "If you experience any issues please open a ticket at:"
echo "https://github.com/Ralim/ts100/issues/new" echo "https://github.com/Ralim/IronOS/issues/new"
echo echo
} }
GAUTOMOUNT=0 GAUTOMOUNT=0
function disable_gautomount { function disable_gautomount {
GSETTINGS=`which gsettings` GSETTINGS=$(which gsettings)
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
return 1 return 1
fi fi
@@ -37,11 +37,11 @@ function enable_gautomount {
} }
function is_attached { function is_attached {
output=`lsblk -b --raw --output NAME,MODEL | grep 'DFU.*Disk'` output=$(lsblk -b --raw --output NAME,MODEL | grep 'DFU.*Disk')
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
return 1 return 1
fi fi
DEVICE=`echo $output | awk '{print "/dev/"$1}'` DEVICE=$(echo $output | awk '{print "/dev/"$1}')
} }
instructions="not printed" instructions="not printed"
@@ -102,7 +102,7 @@ if [ ! -f "$1" ]; then
exit 1 exit 1
fi fi
if [ `head -c1 "$1"` != ":" ] || [ `tail -n1 "$1" | head -c1` != ":" ]; then if [ $(head -c1 "$1") != ":" ] || [ $(tail -n1 "$1" | head -c1) != ":" ]; then
echo "'$1' doesn't look like a valid HEX file. Please provide a HEX file to flash" echo "'$1' doesn't look like a valid HEX file. Please provide a HEX file to flash"
usage usage
exit 1 exit 1