This is the meaning of the script. Whether it is necessary to check up there is 10.0.0.0.0/8.
And if before then update the route, if not then add it.
script for dhcp-client
#does not work
Code: Select all
:global route10;
:set route10 [/ip route get value-name=active [find dst-address=10.0.0.0/8]];
:if ($bound=1) do={:if ($route10=true) do={/ip route set [find dst-address=10.0.0.0/8] gateway=$"gateway-address" } else={/ip route add dst-address=10.0.0.0/8 gateway=$"gateway-address"}};
#does not work
Code: Select all
[code]
:global route10;
:set route10 [ip route get value-name=active [find dst-address=10.0.0.0/8]];
:if (($bound=1) and ($route10=true)) do={/ip route set [find dst-address=10.0.0.0/8] gateway=$"gateway-address" };
:if (($bound=1) and ($route10!=true)) do={/ip route add dst-address=10.0.0.0/8 gateway=$"gateway-address" };
Why my script does not work?