some more minor fixes
authorFelix Fietkau <nbd@openwrt.org>
Fri, 7 Oct 2005 17:52:59 +0000 (17:52 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 7 Oct 2005 17:52:59 +0000 (17:52 +0000)
SVN-Revision: 2066

openwrt/package/webif/files/usr/lib/webif/form.awk
openwrt/package/webif/files/usr/lib/webif/webif.sh
openwrt/package/webif/files/www/cgi-bin/webif/upgrade.sh

index 554a9090f82050e1b1f987a67456305193786f0c..8a3d110e72ba357ac31e89ee6bcdbd527405d948 100644 (file)
@@ -7,7 +7,6 @@
 
 BEGIN {
        FS="|"
-       print "<input type=\"hidden\" name=\"submit\" value=\"1\" />"
 }
 
 # trim leading whitespaces 
index fba768d7897b3fd6426d107252873ea17537df02..cace65a377429c76713fc41465207cb8b3adc86e 100644 (file)
@@ -67,10 +67,10 @@ header() {
        _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
index 4aae81fdabf0a86d98b8fe760f92978bb075456d..6de13d330939b7d001fb0656445ee10cad6575b5 100755 (executable)
@@ -1,7 +1,7 @@
 #!/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
@@ -60,13 +60,14 @@ strip_cybertan() {
        </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 ?>