firmware/src/packages/fff/fff-web/files/www/ssl/cgi-bin/upgrade
Tim Niemeyer bd9420b5fb fff-web: add web interface package
Signed-off-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
Reviewed-by: Steffen Pankratz <kratz00@gmx.de>
2015-12-30 16:09:45 +01:00

37 lines
638 B
Plaintext
Executable File

#!/usr/bin/haserl --upload-dir=/tmp --upload-limit=12000
<%
echo -en "content-type: text/plain\r\n\r\n"
case "${GET_func:-$POST_func}" in
apply_firmware)
path="$POST_firmware"
keep="$POST_keep_config"
if [ ! -f "$path" ]; then
echo "(E) Datei nicht gefunden."
exit 1
fi
if [ "$keep" = "yes" ]; then
args=""
else
args="-n"
fi
echo "(I) Starte sysupgrade..."
#apply openwrt or vendor image
sysupgrade $args $path
;;
restore_firmware)
echo "(I) Undo all changes ..."
echo y | firstboot
echo "(I) Rebooting now ..."
reboot
;;
*)
echo "(E) upgrade: Invalid command: '$GET_func'"
;;
esac
%>