<%- local ntm = require "luci.model.network".init() local fwm = require "luci.model.firewall".init() local sys = require "luci.sys" local net local ifaces = { } local netlist = { } for _, net in ipairs(ntm:get_networks()) do if net:name():match("openvpn") then local z = fwm:get_zone_by_network(net:name()) ifaces[#ifaces+1] = net:name() netlist[#netlist+1] = { net:name(), z and z:name() or "-", z } end end table.sort(netlist, function(a, b) if a[2] ~= b[2] then return a[2] < b[2] else return a[1] < b[1] end end) -%>
<% for i, net in ipairs(netlist) do local z = net[3] local c = "#C47441" local t = z and translate("Part of zone %q" % z:name()) or translate("No zone assigned") repeat cmp_if=net[1] if cmp_if:match("openvpn") then sys.exec("echo %q >> /tmp/cmp_if" % cmp_if) else break end %> <% until true %> <% end %>
<%:Profile Name%> <%:Status%>
<%=net[1]%>

(<%=luci.sys.exec("uci get network.%q.ifname" % net[1]:lower())%>)
<%:Collecting data...%>