Hello,
I have this code, the for works but it does not retrieve the “WAN$i” in the if
Thanks for help.
:global WAN1 true
:for i from=1 to=4 do={
:if ("WAN$i" = true) do={
/log error test
}
}
Hello,
I have this code, the for works but it does not retrieve the “WAN$i” in the if
Thanks for help.
:global WAN1 true
:for i from=1 to=4 do={
:if ("WAN$i" = true) do={
/log error test
}
}
It is not a valid script, you cannot construct variable name from values of other variables.
Okey, but do you have a solution for that ?
I have 3 script who check the interface of WAN and set true or false in global variable.
WAN1 = true
WAN2 = false
WAN3 = true
And I need to get the value (true or false) for the meters in a script that retrieves the first interface that is true
:if ($WAN1 = true) do={
/log error test
}
:if ($WAN2 = true) do={
/log error test
}
…
Thanks you.
It’s solved