Community discussions

MikroTik App
 
Wachler
just joined
Topic Author
Posts: 4
Joined: Sat Jan 23, 2010 2:23 pm

simple script with "in"

Sat Jan 23, 2010 3:05 pm

hellou,
i have very simple script:
return true/false if IP adress from registration-table is in range from array Ranges
:local Ranges [:toarray "192.168.1.0/24,192.168.2.0/24"]; \
:foreach i in=[/interface wireless registration-table find] do={ \
:local lastIP [/interface wireless registration-table get $i last-ip]; \
  :foreach j in=$Ranges do={ \    
    :log info ( $lastIP ." je z rozsahu ". $j ." ?"); \
    :log info ( $lastIP in $j); \
  }; \
};
Bad return is only false

I tryed
1) lastIp with "/32"
2) convert lastIp :toip

and false false false... any ideas?

PS:sorry form my english
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: simple script with "in"

Mon Jan 25, 2010 12:06 pm

you have to make that array in different way, and check wiki about scripting - if in is working way you expect it.

EDIT:
it seems that in is broken in 4.5

Who is online

Users browsing this forum: No registered users and 6 guests