#!/usr/bin/haserl --upload-dir=/tmp --upload-limit=12000 <% # prepare if [ "$REQUEST_METHOD" = "POST" ] ; then if [ "$POST_reset" != "" ] ; then # reset if [ "$FORM_really_reset" = "on" ] ; then do_reset=1 MSG='Router wird zurückgesetzt und anschließend neugestartet...' fi elif [ "$POST_upgrade" != "" ] ; then # upgrade if [ ! -f "$HASERL_firmware_path" ] ; then MSG='Firmware Datei nicht gefunden!' elif [ "$(du -k "$HASERL_firmware_path" | cut -f1)" = "0" ] ; then MSG='Firmware Datei ist leer!' elif ! error=$(sysupgrade -T "$HASERL_firmware_path") ; then MSG="Firmware Datei ungültig: ${error}" else if [ "$POST_keep_config" = "on" ] ; then args="" else args="-n" fi do_sysupgrade=1 MSG='Firmware Upgrade wird gestartet...' fi fi fi %> <%in /www/include/header %> <%in /www/include/helpers %> <% show_msg %>
<%in /www/include/footer %> <% # write if [ "$do_reset" = "1" ] ; then echo "" echo y | firstboot reboot echo "" elif [ "$do_sysupgrade" = "1" ] ; then echo "
" echo "# Freeing caches ..." 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 echo "" fi %>