mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-16 17:01:37 +00:00
WIFI2680: Revert inactivefw if sysupgrade fails
Signed-off-by: Owen Anderson <owenthomasanderson@gmail.com>
This commit is contained in:
parent
d6d45ba609
commit
78b1f77a53
@ -34,11 +34,14 @@ fi
|
||||
|
||||
# Set the current version as inactive before the upgrade
|
||||
FW_VERSION=`sed -n 's/FW_IMAGE_ACTIVE:\(.*\)/\1/p' < /usr/opensync/.versions`
|
||||
FW_BACKUP=$(uci get system.tip.inactivefw)
|
||||
uci set system.tip.inactivefw="${FW_VERSION}"
|
||||
uci commit
|
||||
uci commit system
|
||||
|
||||
/sbin/sysupgrade $IMGFILE
|
||||
if [ "$?" != "0" ] ; then
|
||||
uci set system.tip.inactivefw="${FW_BACKUP}"
|
||||
uci commit system
|
||||
echo "$0: Sysupgrade failed."
|
||||
rm /tmp/sysupgrade.meta
|
||||
rm /tmp/upgrade.*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user