Community discussions

MikroTik App
 
Aidenx64
just joined
Topic Author
Posts: 2
Joined: Wed Aug 20, 2014 1:22 am

Logical Operator “!” , “not” a :global variable

Wed Aug 20, 2014 1:35 am

See below line for what I am trying to accomplish.

/ip firewall filter add in-interface=$hsinterface dst-port=53 protocol=udp place-before=1 action=drop

Would like to logical NOT this global variable but have had no joy so far. Is it possible to Logical NOT a global variable?

Thanks in advance,
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: Logical Operator “!” , “not” a :global variable

Wed Aug 20, 2014 10:49 am

just perform the usual string operation when trying to set some value. See scripting section in manual on how to concatenate the value from variable to a string.
 
User avatar
skot
Long time Member
Long time Member
Posts: 584
Joined: Wed Nov 30, 2011 3:05 am

Re: Logical Operator “!” , “not” a :global variable

Thu Aug 21, 2014 12:15 am

I think you can do something like this:
/ip firewall filter add in-interface=("!" . $hsinterface) dst-port=53 protocol=udp place-before=1 action=drop
 
Aidenx64
just joined
Topic Author
Posts: 2
Joined: Wed Aug 20, 2014 1:22 am

Re: Logical Operator “!” , “not” a :global variable

Tue Aug 26, 2014 4:00 am

Awesome, thanks.
 
nonac
newbie
Posts: 27
Joined: Tue Sep 02, 2014 7:36 pm

Re: Logical Operator “!” , “not” a :global variable

Wed Sep 24, 2014 5:20 am

cool! thanks