Zdravím. Mám problém s tímto scriptem.
Potřebuji zjistit zda je pravidlo vypnuté a když ano tak ho zapnout což nefunguje s použitím proměnných.
Mám:
:local comment_name "LAN_Proxy";
:local i [/ip firewall nat get value-name=disabled number=[find comment=[$comment_name]]];
:if (i=true) do={
/ip firewall nat enable [find comment=[$comment_name]];
}
:local comment_name "HTTP-Provoz";
:local i [/ip firewall mangle get value-name=disabled number=[find comment=[$comment_name]]];
:if (i=true) do={
/ip firewall mangle enable [/ip firewall mangle find];
}
:local comment_name "Vse";
:local i [/queue tree get value-name=disabled number=[find comment=[$comment_name]]];
:if (i=true) do={
/queue tree enable [find comment=[$comment_name]];
}
ale ten nefunguje.
Takto napsaný kód funguje:
:local i [/ip firewall nat get value-name=disabled number=[find comment=LAN_Proxy]];
:if (i=true) do={
/ip firewall nat enable [find comment=LAN_Proxy];
}
:local i [/ip firewall mangle get value-name=disabled number=[find comment=HTTP-Provoz]];
:if (i=true) do={
/ip firewall mangle enable [/ip firewall mangle find];
}
:local i [/queue tree get value-name=disabled number=[find comment=Vse]];
:if (i=true) do={
/queue tree enable [find comment=Vse];
}
Používám verzi 5.17
Poradíte mi co mám špatně? Díky