In this example I am trying to see if a bridge VLAN contains an interface name in its array of untagged interfaces. The issue I have is terminating the value in the example below i.e.
* If I do append the semi-colon then it works perfectly unless the value I'm looking for is the last one in the array, at which point it does not find it as the array does not end with a ;untagged~($ifname . ";")
* If I don't append the semi-colon to $ifname the match works like a starts with/partial match rather than matching the whole value in the array. For example if ifname=ether2 and untagged=ether1;ether20;bond1 the where statement below will match ether20 and output a 1 but it should be 0.
Code: Select all
:if ([ /interface bridge vlan print count-only where bridge=$lifbridge vlan-ids=$nativevlan untagged~($ifname . ";"); ] > 0) do={ ... };
P.S> Unrelated but fingers crossed that Mikrotik add an "else if " command to RouterOS