Reboot when memory goes low

Hello,

Need a script that will reboot the router when memory goes lower than 5MB.

Thank you


*RB750G

add a scheduler with this

{
local mem [system resource get free-memory ]
if ($mem < 5120 ) do={/system reboot }
}

Thank you!