Append Bridge vlan values

LOL. I guess not may folks have tried scripting an existing bridge’s trunk ports in 3 years… This problem is since /interface/bridge/vlan’s vlan-ids attribute is an ARRAY type… so [find vlan-ids=10] does not work against the array type. I was hoping I was missing something google/search of forum does not offer advice here…

Now at least since 7.16, access ports can be handled automatically by the “dynamic” entries created by a /interface/vlan and setting pvid= on /interface/bridge/port - so that part has gotten easier (adding L3 /interface/vlan on vlan bridge, will add bridged to a dynamic tagged=) - so one less modification needed. But a script to “add a tagged port” is far from simple, and still working on one… got me here…

I’ve been trying create some “automated” bridged VLAN scripts (see part 1: http://forum.mikrotik.com/t/example-of-automating-vlan-creation-removal-inspecting-using-mkvlan-friends/181480/6), but the part 2 with some scripts to mange “bridge vlan filtering” part is way trickier… The only approach that I’ve found is some complex code that loops over “dynamic=no” in /interface/bridge/vlans… then :foreach over the vlan-ids ARRAY to see if matches one I’m looking for, then do a SET (or if none found, over the two loops, then ADD new /interface/bridge/vlan).

If anyone knows a better technique or trick here, I’m be curious to know.