:local PPPInter "ppp-out1";# jmeno PPP interface :local count 0; :local IP [/ip address get [find interface=$PPPInter] address]; :local IP [:pick $IP 0 [:find $IP "/"]] : log warning "address current is $IP"; :if ([/ping $IP count=5] = 0) do={ : log warning "ping test negative"; /interface disable $PPPInter; :delay 5s; /interface enable $PPPInter; } else={: log warning "test ping O.K"} : log warning "end of test ping"; :delay 30s :while ( $count < 3 ) do={ /interface ppp-client monitor $PPPInter once do={:if ($status != "connected") do= {:set count ($count+1); :log warning "PPP $PPPInter Link Down (#$count)"; :delay 10; } else={ :set count 4; } }; } :if ( $count > 0 && $count <4 ) do={ :log warning "PPP Link Down, Resetting USB Port"; /system routerboard usb power-reset duration=10; } :delay 120s; :log warning "end of test PPP interface."