modules/admin-full: accept any input in vlan setup as long as it contains a number

This commit is contained in:
Jo-Philipp Wich 2010-03-27 17:41:14 +00:00
parent d9cbd92d99
commit 6003886675

View file

@ -65,7 +65,7 @@ m.uci:foreach("network", "switch",
end end
s.create = function(self, section) s.create = function(self, section)
local n = tonumber(section) local n = tonumber(section and section:match("(%d+)"))
if n ~= nil and n >= 0 then if n ~= nil and n >= 0 then
local sn = "%s_%d" %{ x['.name'], n } local sn = "%s_%d" %{ x['.name'], n }
local rv = TypedSection.create(self, sn) local rv = TypedSection.create(self, sn)