Scripting: get gateway

After upgrading from 5.25 to 6 stopped working of the script, as follows:

/ip dhcp-client get “ether1-gateway” gateway
script error: no such item

on 5.25 it`s work fine

:global newgw [/ip dhcp-client get “ether1-gateway” gateway]
:global activegw [/ip route get [find comment=“isp1”] gateway ]
:if ($newgw != $activegw) do={
/ip route set [find comment=“isp1”] gateway=$newgw
}

local gw [ip dhcp-client get [find interface=ether1-gateway ] gateway ]

Thanks. It`s work!

c0d3rSh3ll te estás ganando los porotos :wink:

por que lo dices? :confused: