summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--contrib/uci/luci10
-rw-r--r--src/ffluci/controller/admin/system.lua24
-rw-r--r--src/ffluci/model/cbi/admin_services/dnsmasq.lua19
-rw-r--r--src/ffluci/model/menu/00main.lua2
-rw-r--r--src/ffluci/sys.lua11
-rw-r--r--src/ffluci/view/admin_system/upgrade.htm10
6 files changed, 71 insertions, 5 deletions
diff --git a/contrib/uci/luci b/contrib/uci/luci
index 46795cb439..9196d80004 100644
--- a/contrib/uci/luci
+++ b/contrib/uci/luci
@@ -5,8 +5,14 @@ config core main
config core category_privileges
option public nobody:nogroup
-config extern flash
- option keep "/etc/config /etc/dropbear /etc/openvpn /etc/passwd /etc/ipkg.conf /etc/httpd.conf /etc/firewall.user"
+config extern flash_keep
+ option uci "/etc/config"
+ option dropbear "/etc/dropbear"
+ option openvpn "/etc/openvpn"
+ option passwd "/etc/passwd"
+ option ipkg "/etc/ipkg.conf"
+ option httpd "/etc/httpd.conf"
+ option firewall "/etc/firewall.user"
config public contact
option nickname
diff --git a/src/ffluci/controller/admin/system.lua b/src/ffluci/controller/admin/system.lua
index 102ce99b8d..b0763d8afe 100644
--- a/src/ffluci/controller/admin/system.lua
+++ b/src/ffluci/controller/admin/system.lua
@@ -5,6 +5,7 @@ require("ffluci.http")
require("ffluci.util")
require("ffluci.fs")
require("ffluci.model.ipkg")
+require("ffluci.model.uci")
function action_editor()
local file = ffluci.http.formvalue("file", "")
@@ -176,5 +177,26 @@ function action_sshkeys()
end
function action_upgrade()
- -- To be implemented
+ local ret = nil
+ local plat = ffluci.fs.mtime("/lib/upgrade/platform.sh")
+
+ local image = ffluci.http.formvalue("image")
+ local imgname = ffluci.http.formvalue("image_name")
+ local keepcfg = ffluci.http.formvalue("keepcfg")
+
+ if plat and imgname then
+ local kpattern = nil
+ if keepcfg then
+ local files = ffluci.model.uci.show("luci", "flash_keep")
+ if files.luci and files.luci.flash_keep then
+ kpattern = ""
+ for k,v in pairs(files.luci.flash_keep) do
+ kpattern = kpattern .. " " .. v
+ end
+ end
+ end
+ ret = ffluci.sys.flash(image, kpattern)
+ end
+
+ ffluci.template.render("admin_system/upgrade", {sysupgrade=plat, ret=ret})
end \ No newline at end of file
diff --git a/src/ffluci/model/cbi/admin_services/dnsmasq.lua b/src/ffluci/model/cbi/admin_services/dnsmasq.lua
new file mode 100644
index 0000000000..4dea3221a9
--- /dev/null
+++ b/src/ffluci/model/cbi/admin_services/dnsmasq.lua
@@ -0,0 +1,19 @@
+m = Map("dhcp", "Dnsmasq")
+
+s = m:section(TypedSection, "dnsmasq", "Einstellungen")
+s.anonymous = true
+
+s:option(Flag, "domainneeded", "Anfragen nur mit Domain", "Anfragen ohne Domainnamen nicht weiterleiten")
+s:option(Flag, "authoritative", "Authoritativ", "Dies ist der einzige DHCP im lokalen Netz")
+s:option(Flag, "boguspriv", "Private Anfragen filtern", "Reverse DNS-Anfragen für lokalen Netze nicht weiterleiten")
+s:option(Flag, "filterwin2k", "Windowsanfragen filtern", "nutzlose DNS-Anfragen aktueller Windowssysteme filtern")
+s:option(Flag, "localise", "Lokalisiere Anfragen", "Gibt die Adresse eines Hostnamen entsprechend seines Subnetzes zurück")
+s:option(Value, "local", "Lokale Server")
+s:option(Value, "domain", "Lokale Domain")
+s:option(Flag, "expand_hosts", "Erweitere Hosts", "Fügt Domainnamen zu einfachen Hosteinträgen in der Resolvdatei hinzu")
+s:option(Flag, "nonegcache", "Unbekannte nicht cachen", "Negative DNS-Antworten nicht zwischenspeichern")
+s:option(Flag, "readethers", "Verwende /etc/ethers", "Lese Informationen aus /etc/ethers um den DHCP-Server zu konfigurieren")
+s:option(Value, "leasefile", "Leasedatei", "Speicherort für vergebenen DHCP-Adressen")
+s:option(Value, "resolvfile", "Resolvdatei", "Lokale DNS-Datei")
+
+return m \ No newline at end of file
diff --git a/src/ffluci/model/menu/00main.lua b/src/ffluci/model/menu/00main.lua
index d1c535f769..0877b8fe6d 100644
--- a/src/ffluci/model/menu/00main.lua
+++ b/src/ffluci/model/menu/00main.lua
@@ -12,12 +12,14 @@ act("packages", "Paketverwaltung")
act("passwd", "Passwort ändern")
act("sshkeys", "SSH-Schlüssel")
act("fstab", "Einhängepunkte")
+act("upgrade", "Firmwareupgrade")
act("reboot", "Neu starten")
add("admin", "services", "Dienste", 30)
act("olsrd", "OLSR")
act("httpd", "HTTP-Server")
act("dropbear", "SSH-Server")
+act("dnsmasq", "Dnsmasq")
add("admin", "network", "Netzwerk", 40)
act("vlan", "Switch")
diff --git a/src/ffluci/sys.lua b/src/ffluci/sys.lua
index 367d41e8c1..d8fbaa57a0 100644
--- a/src/ffluci/sys.lua
+++ b/src/ffluci/sys.lua
@@ -52,6 +52,17 @@ function execl(command)
return data
end
+-- Uses "ffluci-flash" to flash a new image file to the system
+function flash(image, kpattern)
+ local cmd = "ffluci-flash "
+ if kpattern then
+ cmd = cmd .. "-k '" .. kapttern:gsub("'", "") .. "' "
+ end
+ cmd = cmd .. "'" .. image:gsub("'", "") .. "'"
+
+ return os.execute(cmd)
+end
+
-- Returns the hostname
function hostname()
return io.lines("/proc/sys/kernel/hostname")()
diff --git a/src/ffluci/view/admin_system/upgrade.htm b/src/ffluci/view/admin_system/upgrade.htm
index e7a8f2f686..d91d169a4a 100644
--- a/src/ffluci/view/admin_system/upgrade.htm
+++ b/src/ffluci/view/admin_system/upgrade.htm
@@ -2,7 +2,7 @@
<h1><%:system System%></h1>
<h2><%:upgrade Upgrade%></h2>
<br />
-<% if sysupgrade then %>
+<% if sysupgrade and not ret then %>
<form method="post" action="<%=controller%>-upload/admin/system/upgrade" enctype="multipart/form-data">
<fieldset class="cbi-section-node">
<div class="cbi-value clear">
@@ -20,7 +20,13 @@
</div>
</fieldset>
</form>
+<% elseif ret then %>
+ <% if ret == 0 then %>
+<div class="ok"><%:flashed Flashvorgang erfolgreich. Router startet neu...%></div>
+ <% else %>
+<div class="error"><%:flasherr Flashvorgang fehlgeschlagen!%> (<%:code Code%> <%=ret%>)</div>
+ <% end %>
<% else %>
-<div class="error"><%:notimplemented Diese Funktion ist leider (noch) nicht eingebaut.%></div>
+<div class="error"><%:notimplemented Diese Funktion steht leider (noch) nicht zur Verfügung.%></div>
<% end %>
<%+footer%> \ No newline at end of file