init: remove file before overwriting

This commit is contained in:
MilhouseVH 2020-01-25 06:53:32 +00:00
parent d829752181
commit db46d22cec

View File

@ -313,6 +313,7 @@ update_file() {
if [ -f "$UPDATE_DIR/$2" -a -f "$3" ]; then if [ -f "$UPDATE_DIR/$2" -a -f "$3" ]; then
mount -o remount,rw /flash mount -o remount,rw /flash
rm -f "$3"
StartProgress percent "Updating $1... " "$3" $(stat -t "$UPDATE_DIR/$2" | awk '{print $2}') StartProgress percent "Updating $1... " "$3" $(stat -t "$UPDATE_DIR/$2" | awk '{print $2}')
# use dd here with conv=fsync so that all writes are non-buffered # use dd here with conv=fsync so that all writes are non-buffered
# ensuring accurate progress - take the sync hit during the # ensuring accurate progress - take the sync hit during the