script of switch routes

I’m sorry for my English. Please, help me to write the script: if the one route is not active, how to turn OFF the second one. And if active - turn ON. Thank you.

try this

{
local status [ip route get value-name=active [find comment=cerez_velton]]
if ($status=true) do={/ip route enable [find comment=MainGW]} else={/ip route disable [find comment=MainGW]}
}

thanks for script of switch routes! works! :smiley: