Community discussions

MikroTik App
 
Berike
just joined
Topic Author
Posts: 2
Joined: Wed Oct 19, 2022 4:32 am

Creating IP list from domain array

Fri Oct 21, 2022 2:47 am

Hello,
I'm new to RouterOS. I'm trying to create a list of IP to be enabled on Walled Garden, but it's not working, could anyone help to check what am I doing wrong?


:global domains {"google-analytics.com","youtube.com"}

:foreach i in=$domains do={
:global site [:resolve $domains]
:global iplistnumber [/ip hotspot walled-garden ip find where dst-address=$site]

:if ($iplistnumber = "") do={
/ip hotspot walled-garden ip add dst-address=$site comment=$domains
:log info "HotSpot>Walled Garden>IP ADDED"
} else={:log info "IP ALREADY EXISTS"}}

Who is online

Users browsing this forum: loloski, massinia, UkRainUa and 14 guests