From e421c2409a1831f092e3b480a185ec5684b6572b Mon Sep 17 00:00:00 2001 From: Sebastian Kinne Date: Fri, 10 Nov 2017 12:51:03 +1100 Subject: [PATCH] Release firmware v3 --- updates/3.update | 23 +++++++++++++++++++++++ updates/current_version | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 updates/3.update diff --git a/updates/3.update b/updates/3.update new file mode 100644 index 0000000..d6cf504 --- /dev/null +++ b/updates/3.update @@ -0,0 +1,23 @@ +function sha256sum() { + python -sBc "import hashlib;print hashlib.sha256(open('$1','rb').read()).hexdigest()" +} + + +echo -e "Update Available. Install will begin in 30 seconds...\n\n" +echo -e "All local LAN Turtle data will be erased.\n\n" +echo -e "Press CTRL+C to CANCEL\n\n" +sleep 30 +echo -e "Downloading Upgrade file, please wait.\n\n" +wget -q -O /tmp/upgrade.bin http://downloads.lanturtle.com/turtle-3.bin +echo -e "Upgrade file downloaded. Verifying file integrity.\n\n" +[[ "$(sha256sum /tmp/upgrade.bin)" == "49f14fb742c1d27053b762fae63c6f3dbe611ef589f7a8a2913d04efe400f11c" ]] && { + echo -e "DO NOT UNPLUG OR POWER DOWN THE LAN TURTLE\n\n" + echo -e "Upgrade in progress. Please wait ~5 minutes.\n" + echo -e "The LAN Turtle will reboot when the upgrade is complete.\n" + echo -e "This SSH session will now close.\n" + echo "sleep 10 && sysupgrade -n /tmp/upgrade.bin" | at now &> /dev/null + sleep 8 && clear + killall sshd +} || { + echo -e "MD5 checksum missmatch. Please try again." +} diff --git a/updates/current_version b/updates/current_version index 0cfbf08..00750ed 100644 --- a/updates/current_version +++ b/updates/current_version @@ -1 +1 @@ -2 +3