Added Version check in sysupgrade

Signed-off-by: Jan Kraus <mayosemmel@gmail.com>

Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
This commit is contained in:
Jan Kraus 2016-04-05 22:00:33 +02:00 committed by Tobias Klaus
parent ff7e8b7a66
commit 1050923f24
1 changed files with 20 additions and 0 deletions

View File

@ -21,6 +21,26 @@ VERSION=$(cat release.nfo|awk -F: '/VERSION:/ { print $2 }')
rm -f release.nfo
echo -ne "Firmware found on server: $VERSION\n"
if [ $VERSION -eq $FIRMWARE_VERSION ]; then
echo -ne "The installed firmware version is already the current version.\n\n"
while true; do
echo -ne "Do you want to reinstall the current version? [y/N]\n"
read DO_UPDATE
case $DO_UPDATE in
[yY])
break
;;
[nN] | "")
exit 1
;;
*)
echo "Invalid input"
;;
esac
done
fi
FILE="${FIRMWARE_COMMUNITY}-${VERSION}-${SOC}-generic-${BOARD}-squashfs-sysupgrade.bin"
echo -ne "Downloading $FILE\n\n"
wget $(uci get firmware.upgrade.path)/${FILE}