1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ctdb-scripts: New functions ip6tables() and iptables_wrapper()

ip6tables() uses the same lock as iptables().  This is done on
suspicion.

iptables_wrapper() takes 1st argument "inet" or "inet6", and the rest
is passed to the correct iptables variant.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2014-11-21 14:39:43 +11:00 committed by Martin Schwenke
parent ed029ae0a1
commit c314ae0b2a

View File

@ -1356,10 +1356,23 @@ ctdb_standard_event_handler ()
}
# iptables doesn't like being re-entered, so flock-wrap it.
iptables()
iptables ()
{
flock -w 30 $CTDB_VARDIR/iptables-ctdb.flock /sbin/iptables "$@"
}
ip6tables ()
{
flock -w 30 $CTDB_VARDIR/iptables-ctdb.flock /sbin/ip6tables "$@"
}
iptables_wrapper ()
{
_family="$1" ; shift
if [ "$_family" = "inet6" ] ; then
ip6tables "$@"
else
iptables "$@"
fi
}
# AIX (and perhaps others?) doesn't have mktemp
if ! which mktemp >/dev/null 2>&1 ; then