IP hotspot host

Hello Gentlemen

I need a script that will block all IP addresses tab HOTSPOT HOST except for those that are in the IP POOL

Thank you

I find somethnig like this but this is not what i’m looking for, there is too many things to write

:foreach HOST in=[/ip hotspot host find]
do={
:local address [/ip hotspot host get $HOST address];
:if ($address~“^10..“||$address~”^192.168.1..”) do={

all is well, do nothing

} else={

remove the host

/ip hotspot host remove $HOST;
}
}

it does not work
IP HOTSPOT HOST.jpg

Probably user has connected router as AP, Please help me to find the problem