reconnect pppoe

hi I have problems with pppoe that sometimes it’s status is connected but no traffic is going trough it. I would need a script that detect when pppoe idle time is >5sec pppoe get disabled and reenabled again

please help!!

/interface pppoe-out1 monitor once do={
:if($idletime >= “5”) do={
disable
enable
whait(5sec);
}
}

or is these possible to do without scripts??
and where I put these script

thanx