Re-exec startup script on Kindle/Kobo when an OTA update is processed on startup (#4062)

So that we may properly pickup potential updates to the startup script
itself.
This commit is contained in:
NiLuJe
2018-07-07 22:27:38 +02:00
committed by GitHub
parent 8ee741f538
commit 6835c18ee6
6 changed files with 53 additions and 25 deletions

View File

@@ -28,8 +28,13 @@ ko_update_check() {
rm -f "${NEWUPDATE}" # always purge newupdate in all cases to prevent update loop
fi
}
# NOTE: Keep doing an initial update check, in addition to one during the restart loop...
# NOTE: Keep doing an initial update check, in addition to one during the restart loop, so we can pickup potential updates of this very script...
ko_update_check
# If an update happened, and was successful, reexec
if [ -n "${fail}" ] && [ "${fail}" -eq 0 ]; then
# By now, we know we're in the right directory, and our script name is pretty much set in stone, so we can forgo using $0
exec ./koreader.sh "${@}"
fi
# load our own shared libraries if possible
export LD_LIBRARY_PATH="${KOREADER_DIR}/libs:${LD_LIBRARY_PATH}"