%# updateFW.htm -%> <% local has_ping6 = fs.access("/bin/ping6") or fs.access("/usr/bin/ping6") local has_traceroute6 = fs.access("/usr/bin/traceroute6") local dns_host = "www.ingeteam.com" local ping_host = "www.ingeteam.com" local route_host = "www.ingeteam.com" local chp = require "luci.model.charging_points" local path = luci.dispatcher.context.requestpath local user, serialnumber, hw_model = chp.whoami(path) local cl = path[1] local fs = require "nixio.fs" local utl = require "luci.util" local mUtl = require "luci.moreUtils" local sn = mUtl.get_serialnumber() local model = mUtl.model(path[3] or sn) local master = mUtl.identify_pseudo_maestre(path[3] or sn ) local method if master == true then method = "uci" else method = path[3].."/uci" end local ifaces = utl.ubus(method,"get",{config = "network", type = "interface"}) local routes = utl.ubus(method,"get",{config = "network", type = "route"}) if ifaces and ifaces.values then ifaces = ifaces.values end for k, v in pairs (ifaces) do if string.find(k, "plc") or string.find(k, "usb") or string.find(k, "loopback") then ifaces[k] = nil end end if routes and routes.values then routes = routes.values end local count = 0; for k , v in pairs (ifaces) do count = count+1 end -%> <%+header%>