Interface Checking Script

Hi guys, I would like to know how to make a script to check if ppp-out1 interfaces’s ip falls in an ip range which is, the first octet
must be 10, second octet 43 , third octet greater than 128 .. eg 10.43.129.23

If ip addres of ppp-out1 falls within the range then

script should exit

but if ip addres of ppp-out1 doesnt fall within the range then script should execute the command

interface ppp-client disable ppp-out1
interface ppp-client enable ppp-out1

this would be on a scheduled task to be run every 10 seconds

Thank you so much for all your help!!!

Take a look at this Return IP octet function.
With this you should be able to easily compare the octets you need.
The rest should be pretty easy.
And have a look at this script.
I love the way it is implemented, as it will only trigger on a change of your public IP - no need to be run every 10 seconds.

Cheers
-Chris

can you check all interface with script?

Thank for the reply but im a complete noob now learning mikrotik scripting and will be happy if i can be assisted on this please
Thanks once again

just a single interface like ppp-out1 and checks if its ip is in the range 10.43… with the 3rd octet greater than 128
and will execute a command if its in the range or isnt
Thanks