gluon-core: delete all network device sections

Delete all default network device sections upon first boot.

Only LAN & WAN networks are defined at this point. We are using the
legacy way of definiting bridges via the interface sections ifname
option.

The prior filtering was based upon a single device and didn't take into
consideration that DSA interface names can be named arbitrarily.

Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
David Bauer 2021-07-06 01:11:01 +02:00
parent e7c45e5425
commit 030246a4fc

View File

@ -74,9 +74,7 @@ uci:delete('network', 'lan')
uci:delete('network', 'wan') uci:delete('network', 'wan')
uci:foreach('network', 'device', function(dev) uci:foreach('network', 'device', function(dev)
if dev['type'] ~= 'bridge' then return end -- Delete all default OpenWrt network device sections.
if dev['ifname'] ~= 'lan' and dev['ifname'] ~= 'wan' then return end
uci:delete('network', dev['.name']) uci:delete('network', dev['.name'])
end) end)