Skip to contentSkip to conversation

check chain exists

LARTC Mihai Vlad 3 participants 3 messages Dec 14, 2003 – Dec 15, 2003

lore
Share & tools
lore

Mihai Vlad

author
#0 lore raw

Easy question:

Can you give me a little piece of script that checks if a custom chain exists in iptables?

Thanks in advance,

Mihai Vlad

#1 lore raw
Quoted 4 lines · Mihai Vlad

Easy question:

Can you give me a little piece of script that checks if a custom chain exists in iptables?

if iptables -L <chain>
then
echo chain found
fi

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.openprojects.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#2 lore raw
In reply to Mihai Vlad
Quoted 10 lines · Mihai Vlad
Quoted 4 lines

Easy question:

Can you give me a little piece of script that checks if a custom chain exists in iptables?

if iptables -L <chain>
then
echo chain found
fi

For whatever it's worth, that command would run quicker as 'iptables -nL <chain>'

-toby
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/