diff --git a/bin/device-install.sh b/bin/device-install.sh index 2904f1e0d..ca60740ab 100755 --- a/bin/device-install.sh +++ b/bin/device-install.sh @@ -45,7 +45,7 @@ shift "$((OPTIND-1))" shift } -if [ -f "${FILENAME}" ] && [ "${FILENAME##*"update"*}" == "$FILENAME" ]; then +if [ -f "${FILENAME}" ] && [ ! -z "${FILENAME##*"update"*}" ]; then echo "Trying to flash ${FILENAME}, but first erasing and writing system information" "$PYTHON" -m esptool erase_flash "$PYTHON" -m esptool write_flash 0x00 ${FILENAME} diff --git a/bin/device-update.sh b/bin/device-update.sh index 47ac8595f..7233f61f6 100755 --- a/bin/device-update.sh +++ b/bin/device-update.sh @@ -43,7 +43,7 @@ shift "$((OPTIND-1))" shift } -if [ -f "${FILENAME}" ] && [ "${FILENAME##*"update"*}" != "$FILENAME" ]; then +if [ -f "${FILENAME}" ] && [ -z "${FILENAME##*"update"*}" ]; then printf "Trying to flash update ${FILENAME}" $PYTHON -m esptool --baud 115200 write_flash 0x10000 ${FILENAME} else