Eventscripts: Fix deprecated iptables ! usage
authorMartin Schwenke <martin@meltin.net>
Wed, 23 May 2012 04:24:40 +0000 (14:24 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 25 May 2012 05:26:07 +0000 (15:26 +1000)
This currently causes warning in the logs.

This change is not SLES10-compatible but we already have some other
non-SLES10-compatible changes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/events.d/11.natgw

index ba6d7a5fb16475694516ac64318dabd474feb506..509375231a2ee814c870708b0bf97919f4d71e0b 100755 (executable)
@@ -28,7 +28,7 @@ delete_all() {
 
        # 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 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
@@ -71,7 +71,7 @@ case "$1" in
        if [ "$MYPNN" = "$NATGWMASTER" ]; then
                # This is the first node, set it up as the NAT GW
                echo 1 >/proc/sys/net/ipv4/ip_forward
-               iptables -A POSTROUTING -t nat -s $CTDB_NATGW_PRIVATE_NETWORK -d ! $CTDB_NATGW_PRIVATE_NETWORK -j MASQUERADE
+               iptables -A POSTROUTING -t nat -s $CTDB_NATGW_PRIVATE_NETWORK ! -d $CTDB_NATGW_PRIVATE_NETWORK -j MASQUERADE
 
                # block all incoming connections to the natgw address
                CTDB_NATGW_PUBLIC_IP_HOST=`echo $CTDB_NATGW_PUBLIC_IP | sed -e "s/\/.*/\/32/"`