%- local ntm = require "luci.model.network".init() local fwm = require "luci.model.firewall".init() local b=luci.sys.exec("a=` cat /etc/config/network | grep \"config interface 'pptp\" | wc -l` ; b=1 ; while [ $b -le $a ] ; do c=`uci show network.pptp$b | wc -l` ; echo $c $b ;if [ $c -eq 5 ]; then uci delete network.pptp$b ; uci commit ;fi; b=$((b+1)) ; done") local b=luci.sys.exec("a=` cat /etc/config/network | grep \"config interface 'l2tp\" | wc -l` ; b=1 ; while [ $b -le $a ] ; do c=`uci show network.l2tp$b | wc -l` ; echo $c $b ;if [ $c -eq 4 ]; then uci delete network.l2tp$b ; uci commit ;fi; b=$((b+1)) ; done") local b=luci.sys.exec("a=` cat /etc/config/network | grep \"config interface 'gre\" | wc -l` ; b=1 ; while [ $b -le $a ] ; do c=`uci show network.gre$b | wc -l` ; echo $c $b ;if [ $c -eq 2 ]; then uci delete network.gre$b ; uci commit ;fi; b=$((b+1)) ; done") local net local ifaces = { } local netlist = { } for _, net in ipairs(ntm:get_networks()) do if net:name() ~= "loopback" 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) -%>