Merge pull request #25 from dpw/24_iptables_w
Check that 'iptables -w' is supported before using it Fixes #24
This commit is contained in:
commit
550aa3045d
1 file changed
+9
-2
+9
-2
@@ -49,9 +49,16 @@ create_bridge() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add_nat_rule() {
|
add_nat_rule() {
|
||||||
if ! iptables -w -t nat -C $1 >/dev/null 2>&1
|
if [ -z "$CHECKED_IPTABLES_W" ] ; then
|
||||||
|
if iptables -S -w >/dev/null 2>&1 ; then
|
||||||
|
IPTABLES_W=-w
|
||||||
|
fi
|
||||||
|
CHECKED_IPTABLES_W=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! iptables $IPTABLES_W -t nat -C $1 >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
iptables -w -t nat -A $1 >/dev/null
|
iptables $IPTABLES_W -t nat -A $1 >/dev/null
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user