<%# Opennet Firmware Copyright 2010 Rene Ejury 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: index.htm 5448 2009-10-31 15:54:11Z jow $ -%> <%+header%> <% local uci = require "luci.model.uci" local cursor = uci.cursor() local on_version = luci.sys.exec("opkg status on-core | awk '{if (/Version/) print $2;}'") local on_id = cursor:get("on-core", "settings", "on_id") if not on_id then on_id = "" end function printZoneLine(zoneName) networks = cursor:get("firewall", "zone_"..zoneName, "network") if networks and relevant(networks) then %> <% if zoneName == "local" then print(luci.i18n.translate([[LOCAL IP Address(es):]])) elseif zoneName == "opennet" then print(luci.i18n.translate([[OPENNET IP Address(es):]])) elseif zoneName == "wan" then print(luci.i18n.translate([[WAN IP Address(es):]])) elseif zoneName == "on_free" then print(luci.i18n.translate([[ON_FREE IP Address(es):]])) end %> <% printInterfaces(networks) %> <% end end function relevant(networks) for network in networks:gmatch("%S+") do iface = cursor:get("network", network, "ifname") if iface and luci.sys.exec("ip address show label "..iface) ~= "" then return true end end return false end function printInterfaces(networks) %> <% for network in networks:gmatch("%S+") do printValues(network) end %>
<%:Interface%> <%:IP%> <%:MAC%> <% print(luci.i18n.translate([[DHCP]])) %>
<% end function printValues(network) ifname = cursor:get("network", network, "ifname") if not ifname or ifname == "none" then return end output = luci.sys.exec([[ ip address show label ]]..ifname..[[ | awk 'BEGIN{ mac="---";ip="---"; } { if ($1 ~ "link") mac=$2; if ($1 ~ "inet") ip=$2; } END{ print "]]..ifname..[["ip""mac""}' ]]) if output and output ~= "" then %> <%=output%> <% local dhcp = cursor:get_all("dhcp", network) if dhcp and dhcp.ignore ~= "1" then %> <%=dhcp.start.." / "..dhcp.limit.." / "..dhcp.leasetime%> <% else print("---") end %> <% end end %>

<%=luci.i18n.translatef("Opennet Firmware (next generation) version %s -- AP %s", on_version, on_id)%>

<%:This is an Access-Point with Opennet-Firmware, a modification of OpenWrt to the requirements of Opennet Rostock.%>