From 16a17ec1580596aac118bb075b5a59bea2afa781 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 17 Nov 2019 23:02:16 +0200 Subject: [PATCH] fwupdate: remove downloaded flag file upon error --- board/common/overlay/sbin/fwupdate | 3 +++ 1 file changed, 3 insertions(+) diff --git a/board/common/overlay/sbin/fwupdate b/board/common/overlay/sbin/fwupdate index a1674df615..6e72dd8430 100755 --- a/board/common/overlay/sbin/fwupdate +++ b/board/common/overlay/sbin/fwupdate @@ -289,12 +289,14 @@ function do_download() { if [[ -z "${url}" ]]; then echo "no such version" 1>&2 + rm ${DOWNLOAD_STARTED_FILE} exit 1 fi free_disk=$(df /data | tail -n 1 | tr -s ' ' | cut -d ' ' -f 4) if [[ "${free_disk}" -lt $((MIN_FREE_DISK * 1024)) ]]; then echo "not enough disk space" 1>&2 + rm ${DOWNLOAD_STARTED_FILE} exit 1 fi @@ -320,6 +322,7 @@ function do_download() { if [[ "$?" != 0 ]]; then cat ${CURL_LOG_FILE} + rm ${DOWNLOAD_STARTED_FILE} exit 1 fi