Skip to content
Snippets Groups Projects
Commit 2caf86d9 authored by Adrian Schmutzler's avatar Adrian Schmutzler Committed by Tim Niemeyer
Browse files

WebUI: Show firmware update notification in WebUI


Displays update notification for user, but does not provide
automatic updates. Version comparison is based on string match,
so build dates are not relevant.

Signed-off-by: default avatarAdrian Schmutzler <freifunk@adrianschmutzler.de>

Tested-by: default avatarAdrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: default avatarMichael Fritscher <fff@mifritscher.de>
parent 1bfb0b06
No related branches found
No related tags found
No related merge requests found
include $(TOPDIR)/rules.mk
PKG_NAME:=fff-web
PKG_VERSION:=0.0.3
PKG_VERSION:=0.0.4
PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/fff-web
......
#!/usr/bin/haserl
<%
. /etc/community.cfg
. /etc/firmware_release
echo -en "Content-Type: text/html\r\n\r\n"
nav_entry() {
script_file="/cgi-bin/$1"
......@@ -12,6 +14,20 @@ nav_entry() {
HOSTNAME=$(uci -q get 'system.@system[0].hostname')
NOW=$(date +%s)
#Check if new Firmware check older then 1 day
if [ ! -s /tmp/fwcheck ] || [ "$(cat /tmp/fwcheck)" -lt "$NOW" ] ; then
rm -f /tmp/isupdate
NEXTUPDATE=$(($(date +%s)+86400))
echo $NEXTUPDATE > /tmp/fwcheck
/usr/bin/wget "${UPGRADE_PATH}/release.nfo" -P /tmp -T 2
VERSION=$(cat /tmp/release.nfo|awk -F: '/VERSION:/ { print $2 }')
rm -f /tmp/release.nfo
if [ "$VERSION" != "$FIRMWARE_VERSION" -a -n "$VERSION" ]; then
echo $VERSION > /tmp/isupdate
fi
fi
%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
......@@ -47,3 +63,13 @@ HOSTNAME=$(uci -q get 'system.@system[0].hostname')
<div id="container">
<div id="primarycontainer">
<div id="primarycontent">
<%
if [ -s /tmp/isupdate ] ; then
VERSION=$(cat /tmp/isupdate)
%>
<table style="width: 100%;">
<tr>
<td><span style="font-size: 16pt; color:#FF0000">Es ist eine neue Firmware für deinen Freifunkrouter verfügbar.<br />Alte Version: <%= ${FIRMWARE_VERSION} %> - Neue Version: <%= ${VERSION} %> <br /><a href="upgrade.html">Firmware jetzt updaten</a></span></td>
</tr>
</table>
<% fi %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment