1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-23 06:50:21 +03:00

ctdb-eventscripts: Reformat natgw_clear()

Signed-off-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Martin Schwenke 2014-03-07 13:55:47 +11:00 committed by Amitay Isaacs
parent 3c839c60d1
commit e22a22b1f7

View File

@ -38,18 +38,20 @@ natgw_set_capability ()
natgw_clear ()
{
_ip="${CTDB_NATGW_PUBLIC_IP%/*}"
_maskbits="${CTDB_NATGW_PUBLIC_IP#*/}"
_ip="${CTDB_NATGW_PUBLIC_IP%/*}"
_maskbits="${CTDB_NATGW_PUBLIC_IP#*/}"
delete_ip_from_iface $CTDB_NATGW_PUBLIC_IFACE $_ip $_maskbits >/dev/null 2>&1
ip route del 0.0.0.0/0 metric 10 >/dev/null 2>/dev/null
delete_ip_from_iface \
$CTDB_NATGW_PUBLIC_IFACE $_ip $_maskbits >/dev/null 2>&1
ip route del 0.0.0.0/0 metric 10 >/dev/null 2>/dev/null
# Delete the masquerading setup from a previous iteration where we
# were the NAT-GW
iptables -D POSTROUTING -t nat -s $CTDB_NATGW_PRIVATE_NETWORK ! -d $CTDB_NATGW_PRIVATE_NETWORK -j MASQUERADE >/dev/null 2>/dev/null
# Delete the masquerading setup from a previous iteration where we
# were the NAT-GW
iptables -D POSTROUTING -t nat \
-s $CTDB_NATGW_PRIVATE_NETWORK ! -d $CTDB_NATGW_PRIVATE_NETWORK \
-j MASQUERADE >/dev/null 2>/dev/null
# remove any iptables rule we may have on this address
iptables -D INPUT -p tcp --syn -d $_ip/32 -j REJECT 2>/dev/null
iptables -D INPUT -p tcp --syn -d $_ip/32 -j REJECT 2>/dev/null
}
natgw_set_master ()