Community discussions

MikroTik App
 
User avatar
CristianDeluxe
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Fri Jun 05, 2009 10:59 am
Location: Spain
Contact:

Check if mangle rule is enabled?

Fri Jul 30, 2010 10:56 am

Hi, how can i check if a mangle rule is enabled or disabled using scripting?
 
User avatar
CristianDeluxe
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 53
Joined: Fri Jun 05, 2009 10:59 am
Location: Spain
Contact:

Re: Check if mangle rule is enabled?

Fri Jul 30, 2010 11:24 am

Ok i found the answer:
:local chkenabled

:set chkenabled [/ ip firewall mangle get number=1 disabled]
if($chkenabled) do={
# Rule is disabled
} else={
# Rule is enabled
}
 
Feklar
Forum Guru
Forum Guru
Posts: 1724
Joined: Tue Dec 01, 2009 11:46 pm

Re: Check if mangle rule is enabled?

Tue Aug 03, 2010 9:55 pm

To make it easier to find a mangle rule than via the number you can use this instead and find it by a comment, or really any of the set attributes of the rule(s):
:set chkenabled [/ ip firewall mangle find [comment="your comment"] disabled]