#!/usr/bin/haserl <% . /lib/functions/fff/keyxchange . /etc/firmware_release UPGRADE_PATH="$(getUpgradePath)" echo -en "Content-Type: text/html\r\n\r\n" HOSTNAME="$(uci -q get "fff.system.hostname")" hood="$(uci -q get "system.@system[0].hood")" NOW=$(date +%s) #Check if new Firmware check older then 1 day if ( [ ! -s /tmp/fwcheck ] || [ "$(cat /tmp/fwcheck)" -lt "$NOW" ] ) && [ ! "$(uci -q get fff.notifyupdate.value)" = "0" ] ; then rm -f /tmp/isupdate NEXTUPDATE=$(($(date +%s)+86400)) echo $NEXTUPDATE > /tmp/fwcheck /bin/busybox 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 %> <%= ${HOSTNAME} %>
<% if [ -s /tmp/isupdate ] ; then VERSION=$(cat /tmp/isupdate) %>
Es ist eine neue Firmware für deinen Freifunkrouter verfügbar.
Alte Version: <%= ${FIRMWARE_VERSION} %> - Neue Version: <%= ${VERSION} %>
Firmware jetzt updaten
<% fi %>