Merge pull request #1995 from MilhouseVH/le90_upgrade_single_shot

init: recover from a failed upgrade
This commit is contained in:
Christian Hewitt 2017-09-20 19:31:31 +04:00 committed by GitHub
commit aedad0fea8

View File

@ -779,8 +779,16 @@
return 0
fi
# remove temporary folder if exist from previous run
rm -fr "$UPDATE_DIR/.tmp" &>/dev/null
if [ -d $UPDATE_DIR/.tmp ]; then
echo "Failed update detected - performing recovery."
echo ""
do_cleanup
StartProgress countdown "Normal startup in 10s... " 10 "NOW"
return 0
fi
mkdir -p $UPDATE_DIR/.tmp &>/dev/null
sync
echo "UPGRADE IN PROGRESS"
echo ""
@ -793,7 +801,6 @@
echo "Found new .tar archive"
UPDATE_FILENAME="$UPDATE_TAR"
StartProgress spinner "Extracting contents of archive... "
mkdir -p $UPDATE_DIR/.tmp &>/dev/null
tar -xf "$UPDATE_TAR" -C $UPDATE_DIR/.tmp 1>/dev/null 2>/tmp/tarresult.txt || TARRESULT="1"
if [ "${TARRESULT}" -eq "0" ]; then