[find not working now.

Currently running 4.2 and the following script doesn’t work.

/ip proxy access set [find dst-port=80] action=deny

This is used as a scheduled script to turn off internet access for my kids after a certain hour. :slight_smile:

:foreach RULE in=[/ip proxy access find dst-port="80"] do={ /ip proxy access set $RULE action=deny }

Or alternatively

/ip proxy access set [find dst-port="80"] action=deny

But I like a loop better since it indicates very clearly that it works on multiple elements.

Hmm.. Why would something like that change between versions, especially for a number? I was using this in 3.x and it worked fine without quotes around the 80. Then again, they changed /ip web-proxy to just /ip proxy, which messed things up too..

Anyway, that worked fine. Thanks.

Precisely why. You answered your own question :slight_smile:

I agree with the loop method fewi mentioned as well. I’ve been noting it on everything I do involving find. It’s worked for me from v2.x → v3.x → v4.x with very good consistency. When you combine [:tonum], [:tostr], [:toip], and [:tobool], you get about 99.9999 % consistent between any version of RouterOS.