% -- Copyright 2015 OVH (OverTheBox@ovh.net) -- Simon Lelievre (simon.lelievre@corp.ovh.com) -- Sebastien Duponcheel (sebastien.duponcheel@ovh.net) -- -- This file is part of OverTheBox for OpenWrt. -- -- OverTheBox is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- OverTheBox is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with OverTheBox. If not, see (http://www.gnu.org/licenses/) -%> <%- local ntm = require "luci.model.network".init() local uci = require "luci.model.uci".cursor() local dev local devices = { "all" } for _, dev in luci.util.vspairs(luci.sys.net.devices()) do if dev ~= "lo" and not ntm:ignore_interface(dev) then if uci:get("network", dev, "type") == "tunnel" then devices[#devices+1] = dev end end end local curdev = luci.dispatcher.context.requestpath curdev = curdev[#curdev] ~= "tunnels" and curdev[#curdev] or devices[1] -%> <%+header%>