_saved_title=${ERROR:+: Settings not saved}
_saved_title=${_saved_title:-$SAVED}
_head="${3:+<div class=\"settings-block-title\"><h2>$3$_saved_title</h2></div>}"
- _form="${5:+<form enctype=\"multipart/form-data\" action=\"$5\" method=\"post\">}"
+ _form="${5:+<form enctype=\"multipart/form-data\" action=\"$5\" method=\"post\"><input type="hidden" name="submit" value="1" />}"
_savebutton="${5:+<p><input type=\"submit\" name=\"action\" value=\"Save changes\" /></p>}"
_categories=$(categories $1)
- _subcategories=${2:+$(subcategories $1 $2)}
+ _subcategories=${2:+$(subcategories "$1" "$2")}
update_changes
cat <<EOF
#!/usr/bin/haserl -u
<?
. /usr/lib/webif/webif.sh
-header "System" "Firmware upgrade" "Firmware Upgrade"
+header "System" "Firmware upgrade" "Firmware upgrade"
strip_cybertan() {
dd if="$FORM_firmware" of=/tmp/upgrade.bin bs=32 skip=1 2>/dev/null
</form>
<?el?>
<?
- ERASE=""
- [ "$FORM_erase_fs" = 1 ] && ERASE="-e linux "
- [ "$FORM_erase_nvram" = 1 ] && ERASE="$ERASE -e nvram "
+ ERASE="${FORM_erase_fs:+-e linux }"
+ ERASE="$ERASE${FORM_erase_nvram:+-e nvram }"
+ cp /bin/busybox /tmp/
+ echo -n 'Upgrading... '
+ # FIXME: probably a race condition (with the reboot), but it seems to work
+ mtd -r $ERASE write /tmp/upgrade.bin linux 2>&- | awk 'END { print "done." }'
+ exit
?>
-Upgrading...
-<? mtd -r $ERASE write /tmp/upgrade.bin linux 2>&- >&- ?>
-done <br />
<?fi?>
<? footer ?>