lanturtle-modules/updates/2.update

19 lines
913 B
Plaintext

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\n\n"
wget -q -O /tmp/upgrade.bin https://downloads.hak5.org/api/devices/lanturtle/firmwares/2-stable
echo -e "Upgrade file downloaded. Verifying files.\n\n"
[[ "$(md5sum /tmp/upgrade.bin | awk '{print $1}')" == "479ebbb06ceea051d383d2e635a08e18" ]] && {
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."
}