Community discussions

MikroTik App
 
lukkes
Member Candidate
Member Candidate
Topic Author
Posts: 177
Joined: Mon Jun 16, 2008 2:12 am
Location: Venezuela
Contact:

run an array and compare

Sat Apr 09, 2016 6:00 am

good nights,

i have an array with routing marks

array1 ("wan1","wan2","wan3","wan4","wan5",..."wanX")

and I get an array with the command
:foreach routes in=[/ip route find where comment~"^[a-z]*wan" ] do={
   :set routename ([/ip route get $routes comment]);
   :set array2 ($array2, $routename);
}
the second array sometimes fill with ("wan3","wan2","wan1"..."wanX")

the first problem is that the second array is filled in unsorted order, so i need to compare if all the mark on
array1 appears on array2, if not, i will create the route dynamic,
so how i can run both arrays to compare?

thanks

Who is online

Users browsing this forum: FoxWhite and 19 guests