@@ -10,6 +10,9 @@ if [ "$REQUEST_METHOD" = "POST" ] ; then
MSG='<span class="green">Router wird zurückgesetzt und anschließend neugestartet...</span>'
fi
elif [ "$POST_upgrade" != "" ] ; then
+ # remove firmware files from previous tries
+ rm -f /tmp/uploadedfw.bin
+
# upgrade
if [ ! -f "$HASERL_firmware_path" ] ; then
MSG='<span class="red">Firmware Datei nicht gefunden!</span>'
@@ -74,7 +77,7 @@ elif [ "$do_sysupgrade" = "1" ] ; then
echo 3 > /proc/sys/vm/drop_caches
echo "# sysupgrade $args /tmp/uploadedfw.bin"
mv -f "$HASERL_firmware_path" /tmp/uploadedfw.bin
- sysupgrade $args /tmp/uploadedfw.bin || rm /tmp/uploadedfw.bin
+ sysupgrade $args /tmp/uploadedfw.bin
echo "</pre>"
fi
%>
For some reason sysupgrade seems to return exit status != 0 even on successful calls. As the binary is removed if sysupgrade exists with a failure status, it is possible that it got deleted while a sysupgrade has been in progress. Therefore, instead of deleting the firmware on specific exit status of sysupgrade, the binary is removed on subsequent binary uploads. Signed-off-by: Fabian Bläse <fabian@blaese.de> --- src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)