Skip to content
Snippets Groups Projects
Commit 2dfa8b8d authored by David Bauer's avatar David Bauer
Browse files

gluon-core: use delete_all instead of iterated delete

Use a delete_call with a boolean parameter function instead of manually
iterating over all devices.

Link: https://github.com/freifunk-gluon/gluon/pull/3102



Signed-off-by: default avatarDavid Bauer <mail@david-bauer.net>
parent dc841ea4
No related branches found
No related tags found
No related merge requests found
...@@ -93,10 +93,8 @@ end ...@@ -93,10 +93,8 @@ end
-- Delete all UCI device sections of type 'bridge' -- Delete all UCI device sections of type 'bridge'
-- as well as the ones starting with 'br-'. -- as well as the ones starting with 'br-'.
-- Preserve all others to apply MAC address stored in UCI -- Preserve all others to apply MAC address stored in UCI
uci:foreach('network', 'device',function(s) uci:delete_all('network', 'device', function(dev)
if s.type == 'bridge' or s.name:match('^br-') then return (dev.type == 'bridge' or dev.name:match('^br-'))
uci:delete('network', s['.name'])
end
end) end)
uci:delete_all('network', 'interface') uci:delete_all('network', 'interface')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment