--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>LuCI - System Upgrade</title>
+
+ <style type="text/css">
+ body {
+ background-color: #CCCCCC;
+ font-family: sans-serif;
+ font-size: 90%;
+ padding-left: 50%;
+ padding-top: 100px;
+ }
+
+ h2 {
+ font-size: 110%;
+ margin: 5px 5px 0.5em 5px;
+ border-bottom: 1px dotted #0066CC;
+ color: #0066CC;
+ }
+
+ p {
+ font-size: 95%;
+ margin: 15px 15px 0.5em 15px;
+ }
+
+ div {
+ background-color: #F7F7F7;
+ border: 1px dotted #000000;
+ width: 600px;
+ height: 150px;
+ margin-left: -300px;
+ }
+
+ em {
+ color: #555555;
+ }
+ </style>
+
+ <script type="text/javascript"><!--
+ var time_remaining = 60 * 20;
+ var interval = window.setInterval(function() {
+ if( time_remaining <= 0 )
+ {
+ window.clearInterval(interval);
+ location.href = 'http://' + location.hostname + '/';
+ }
+ else
+ {
+ var minutes = Math.floor(time_remaining / 60);
+ var seconds = time_remaining % 60;
+ var label = document.getElementById('time_remaining');
+
+ if( label )
+ {
+ label.innerHTML =
+ ( minutes > 0 ? minutes + 'm ' : '' ) +
+ seconds + 's';
+ }
+ }
+
+ time_remaining = time_remaining - 1;
+ }, 1000);
+ --></script>
+</head>
+
+<body class="lang_en">
+ <div>
+ <h2>Performing Upgrade</h2>
+
+ <p>
+ The System is flashing now. The procedure can take up to 20 minutes,
+ please be patient and wait until this page reloads itself.
+
+ <br /><img src="resources/flashing.gif" style="vertical-align:middle; margin:10px" />
+
+ <em>Remaining time (estimated): <span id="time_remaining">unknown</span></em>
+ </p>
+ </div>
+</body>
+
+</html>
--- /dev/null
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2009 Jo-Philipp Wich <xm@subsignal.org>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id: freifunk.lua 4649 2009-05-26 18:30:00Z jow $
+]]--
+
+local nixio = require "nixio"
+
+module("luci.controller.freifunk.remote_update", package.seeall)
+
+function index()
+ local i18n = luci.i18n.translate
+
+ entry({"admin", "system", "remote_update"}, call("act_remote_update"),
+ i18n("ff_remote_update", "Freifunk Remote Update"), 90)
+end
+
+function act_remote_update()
+ if luci.http.formvalue("flash") == "1" then
+ if luci.http.formvalue("confirm") == "1" then
+ local nobackup = ( luci.http.formvalue("keepcfg") ~= "1" )
+ local noverify = ( luci.http.formvalue("verify") ~= "1" )
+
+ luci.http.redirect("/luci-static/flashing.html")
+
+ os.execute("start-stop-daemon -S -b -x /usr/sbin/remote-update -- %s%s-s 5 -y" % {
+ noverify and "-v " or "",
+ nobackup and "-n " or ""
+ })
+ else
+ luci.template.render("freifunk/remote_update", {confirm=1})
+ end
+ else
+ local fd = io.popen("remote-update -c")
+ local update = { }
+
+ if fd then
+ while true do
+ local ln=fd:read("*l")
+
+ if not ln then break
+ elseif ln:find("Local: ") then update.locvar = ln:match("Local: (%d+)")
+ elseif ln:find("Remote: ") then update.remver = ln:match("Remote: (%d+)")
+ elseif ln == "--" then update.info = ""
+ elseif update.info ~= nil then
+ update.info = update.info .. ln .. "\n"
+ end
+ end
+
+ fd:close()
+ end
+
+ luci.template.render("freifunk/remote_update", {update=update})
+ end
+end
--- /dev/null
+<%#
+LuCI - Lua Configuration Interface
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id: contact.htm 3529 2008-10-07 13:10:24Z jow $
+
+-%>
+<%+header%>
+
+<h2><%:ff_remote_update Freifunk Remote Update%></h2>
+
+<p><%:ff_remote_update_desc Check for new firmware versions and perform automatic updates.%></p>
+
+<% if update then %>
+
+ <% if update.info then %>
+ <strong><%:ff_remote_update_available Update available!%></strong>
+ <br /><br />
+ <pre><%=update.info%></pre><br />
+ <% else %>
+ <strong><%:ff_remote_update_uptodate The installed firmware is the most recent version.%></strong>
+ <br /><br />
+ <% end %>
+
+ <p>
+ <form method="post" action="" class="inline">
+ <input type="hidden" name="flash" value="1" />
+ <input type="submit" class="cbi-button cbi-button-apply" value="<%:ff_remote_update_install Start Upgrade%>" />
+ </form>
+ </p>
+
+<% elseif confirm then %>
+
+ <strong><%:ff_remote_update_settings Update Settings%></strong>
+ <br /><br />
+
+ <p><form method="post" action="" class="inline">
+ <input type="hidden" name="flash" value="1" />
+ <input type="hidden" name="confirm" value="1" />
+
+ <input type="checkbox" class="cbi-input-checkbox" name="keepcfg" value="1" checked="checked" id="cb_keepcfg" />
+ <label for="cb_keepcfg"><%:ff_remote_update_keepcfg Keep configuration%></label><br />
+
+ <input type="checkbox" class="cbi-input-checkbox" name="verify" value="1" checked="checked" id="cb_verify" />
+ <label for="cb_verify"><%:ff_remote_update_keepcfg Verify downloaded images%></label><br /><br />
+
+ <input type="submit" class="cbi-button cbi-button-apply" value="<%:ff_remote_update_install Confirm Upgrade%>" />
+ </form></p>
+
+<% end %>
+
+<%+footer%>
config defaults upgrade
option repository "http://dev.luci.freifunk-halle.net/freifunk-snapshots"
+ option rssfeed "http://firmware.leipzig.freifunk.net/kamikaze/.rss.xml"
config community leipzig
option name "Freifunk Leipzig"
echo $1
}
+find_remote_info()
+{
+ wget -qO- "${1%/*}/VERSION.txt" 2>/dev/null
+}
+
find_remote_version()
{
- wget -qO- "${1%/*}/VERSION.txt" 2>/dev/null | \
+ find_remote_info "$1" | \
sed -ne "s!.*$D4/$D2/$D2 $D2:$D2.*!\\1\\2\\3\\4\\5!p;t"
}
[ -n "$v1" -a -n "$v2" ] && {
version_compare "$v1" "$v2"
[ $? == 2 ] && {
- echo "Update available! $v1 -> $v2"
+ echo "Update available!${NL}Local: $v1${NL}Remote: $v2${NL}--"
+ find_remote_info "$image_url"
+ exit 0
} || {
echo "Local version $v1 is up to date"
+ exit 2
}
} || {
echo "No remote time stamp found."
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-06-07 22:10+0200\n"
-"PO-Revision-Date: 2009-06-07 22:17+0200\n"
+"POT-Creation-Date: 2009-06-30 06:43+0200\n"
+"PO-Revision-Date: 2009-06-30 06:47+0200\n"
"Last-Translator: Jo-Philipp Wich <xm@subsignal.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
#. IP-P2P
msgid "ff_p2pblock_ipp2p"
msgstr "IPP2P"
+
+#. Freifunk Remote Update
+msgid "ff_remote_update"
+msgstr "Freifunk Fernupdate"
+
+#. Check for new firmware versions and perform automatic updates.
+msgid "ff_remote_update_desc"
+msgstr ""
+"Der Fernupdate-Mechanismus prüft nach neuen Firmware-Versionen und führt "
+"automatisierte Updates durch."
+
+#. Update available!
+msgid "ff_remote_update_available"
+msgstr "Update verfügbar!"
+
+#. The installed firmware is the most recent version.
+msgid "ff_remote_update_uptodate"
+msgstr "Die installierte Firmware ist bereits die neueste Version."
+
+#. Start Upgrade
+msgid "ff_remote_update_install"
+msgstr "Updatevorgang starten"
+
+#. Update Settings
+msgid "ff_remote_update_settings"
+msgstr "Einstellungen zum Update"
+
+#. Keep configuration
+msgid "ff_remote_update_keepcfg"
+msgstr "Konfigurationsdateien wiederherstellen"
+
+#. Verify downloaded images
+msgid "ff_remote_update_keepcfg"
+msgstr "Heruntergeladene Images verifizieren"
+
+#. Confirm Upgrade
+msgid "ff_remote_update_install"
+msgstr "Update bestätigen"
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-06-07 22:10+0200\n"
-"PO-Revision-Date: 2009-06-07 22:18+0200\n"
+"POT-Creation-Date: 2009-06-30 06:42+0200\n"
+"PO-Revision-Date: 2009-06-30 06:43+0200\n"
"Last-Translator: Jo-Philipp Wich <xm@subsignal.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
#. IP-P2P
msgid "ff_p2pblock_ipp2p"
msgstr "IP-P2P"
+
+#. Freifunk Remote Update
+msgid "ff_remote_update"
+msgstr "Freifunk Remote Update"
+
+#. Check for new firmware versions and perform automatic updates.
+msgid "ff_remote_update_desc"
+msgstr "Check for new firmware versions and perform automatic updates."
+
+#. Update available!
+msgid "ff_remote_update_available"
+msgstr "Update available!"
+
+#. The installed firmware is the most recent version.
+msgid "ff_remote_update_uptodate"
+msgstr "The installed firmware is the most recent version."
+
+#. Start Upgrade
+msgid "ff_remote_update_install"
+msgstr "Start Upgrade"
+
+#. Update Settings
+msgid "ff_remote_update_settings"
+msgstr "Update Settings"
+
+#. Keep configuration
+msgid "ff_remote_update_keepcfg"
+msgstr "Keep configuration"
+
+#. Verify downloaded images
+msgid "ff_remote_update_keepcfg"
+msgstr "Verify downloaded images"
+
+#. Confirm Upgrade
+msgid "ff_remote_update_install"
+msgstr "Confirm Upgrade"
#. IP-P2P
msgid "ff_p2pblock_ipp2p"
msgstr ""
+
+#. Freifunk Remote Update
+msgid "ff_remote_update"
+msgstr ""
+
+#. Check for new firmware versions and perform automatic updates.
+msgid "ff_remote_update_desc"
+msgstr ""
+
+#. Update available!
+msgid "ff_remote_update_available"
+msgstr ""
+
+#. The installed firmware is the most recent version.
+msgid "ff_remote_update_uptodate"
+msgstr ""
+
+#. Start Upgrade
+msgid "ff_remote_update_install"
+msgstr ""
+
+#. Update Settings
+msgid "ff_remote_update_settings"
+msgstr ""
+
+#. Keep configuration
+msgid "ff_remote_update_keepcfg"
+msgstr ""
+
+#. Verify downloaded images
+msgid "ff_remote_update_keepcfg"
+msgstr ""
+
+#. Confirm Upgrade
+msgid "ff_remote_update_install"
+msgstr ""