Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 22540

Scripting • Re: The issue of a function containing variables unsuccessfully.

$
0
0

:global FirewallNatAction do={
:global actionValue;
:set actionValue $actionValue;
:put $actionValue
:execute "/ip firewall nat $actionValue [find comment~\"hack_dns\"]" as-string
}
$FirewallNatAction actionValue=enable


Code:
/ip firewall nat disable [find where comment~"hack_dns"]

Code:
:global FirewallNatAction do={  :execute "/ip firewall nat $1 [find where comment~\"hack_dns\"]"}$FirewallNatAction enable

Or disable/enable
Code:
/ip firewall nat find [set [find where comment~"hack_dns"] disabled=(!($disabled))]

Statistics: Posted by rextended — Tue Jun 04, 2024 3:00 am



Viewing all articles
Browse latest Browse all 22540

Trending Articles