script not running in 6.46.2 but it was fine in 6.42.11
:local newgw [ip dhcp-client get [find comment=“WAN1”] gateway];
:local routegw [/ip route get [find comment=“WAN1”] gateway ];
:if ($newgw != $routegw) do={
/ip route set [find comment=“WAN1”] gateway=$newgw;
}
:local newgw [ip dhcp-client get [find comment=“WAN3”] gateway];
:local routegw [/ip route get [find comment=“WAN3”] gateway ];
:if ($newgw != $routegw) do={
/ip route set [find comment=“WAN3”] gateway=$newgw;
}
Why exactly are you using this script ?
Since you can let a dynamic route to be added inside your routes tabale…