:global newIP [/ip address get [find interface="PPPoE"] address];
# parse the current IP result
:local resultLen [:len $newIP]
:local startLoc 0
:local endLoc [:find $newIP "/" -1]
:global currentIP [:pick $newIP $startLoc $endLoc]
:if ($currentIP = 213) do={
/interface pppoe-client disable PPPoE
:delay 30
/interface pppoe-client enable PPPoE
}
:global newIP [/ip address get [find interface="PPPoE"] address];
:if ($newIP in 213.0.0.0/8) do={
/interface pppoe-client disable PPPoE
:delay 30
/interface pppoe-client enable PPPoE
}
:local endLoc [:find $newIP "/" -1]
:local endLoc [:find $newIP "." -1]
:local "current-ip" [:pick [/ip address get [find interface =PPPoE] address ] 0 3]
:if ($currentIP = 213) do={
/interface pppoe-client disable PPPoE
:delay 30
/interface pppoe-client enable PPPoE
}
:global "out-interface" "pppoe"
:local "current-ip" [/ip address get [find interface=$"out-interface"] address]
:local "result" [:find $current-ip "." -1]
:if ($result = 213) do={
/interface pppoe-client disable $"out-interface"
:delay 30
/interface pppoe-client enable $"out-interface"
}
/system scheduler
add disabled=no interval=1m name=myscript on-event="/system script run myscript" policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive,api start-time=startup
:local newIP [:pick [/ip address get [find interface ="RT"] address ] 0 3]
:if ($newIP != 212) do={
/interface pppoe-client disable RT
:delay 5
/interface pppoe-client enable RT
}