Revert "eventscripts: Reformat natgw_clear()"
authorAmitay Isaacs <amitay@gmail.com>
Mon, 31 Mar 2014 02:25:43 +0000 (13:25 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Mon, 31 Mar 2014 02:31:43 +0000 (13:31 +1100)
This reverts commit 41b630097d0cabfe32bd2b3cf9cbcae9aeff5c5f.

Wrong imported commit information.

config/events.d/11.natgw

index ae093058564b1b72d1d2c0479e149377e3472164..852f8f2e29ca699ab46f2cac595b2b780a3d7972 100755 (executable)
@@ -38,20 +38,18 @@ 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
 
-    iptables -D INPUT -p tcp --syn -d $_ip/32 -j REJECT 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
 }
 
 natgw_set_master ()