PPP reboot script

Hello,

Excuse me if there is another topic.
I am using Mikrotik RB3011UiAS-RM (last software version) and i need a script to reboot USB stick (3g modem) if there is no connection through it.

I’ve already tried the script below but nothing really happened:
/interface ppp-client monitor ppp-LAN_Internet once do={:if ($status != “connected”) do= {:log warning “3G Modem Down, reset USB”; /system routerboard usb power-reset duration=5}}; :delay 120;


I will appreciate some help on this matter.
Thank you in advance!

I use this script:

{
:if ([/ping 8.8.4.4 count=5] = 0) do={
:log warning “4G DOWN”;
/system routerboard usb power-reset duration=5;
} else={
:log warning “4G UP”;
}
}

3G Modem is my backup connection, so i am trying to make script that will ping public addresses through 3G Modem (despite that it is my backup connection and all the traffic goes through the WAN interface with my ISP) and power-reset the usb if there is no ping.

Is that even possible?