In the example script to remove all ip addresses after a ctdb crash,
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 22 Apr 2010 22:35:01 +0000 (08:35 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 22 Apr 2010 23:08:26 +0000 (09:08 +1000)
add the NATGW address as one to be removed in addition to the
public addresses.

config/ctdb-crash-cleanup.sh

index ca6a83860d1004476bb29812795db886baf4ca51..420db76727b9e65f7fa625647f9ddd6752b1c3de 100755 (executable)
@@ -22,7 +22,7 @@ ctdb status 2>/dev/null && {
     exit 0
 }
 
-cat "$CTDB_PUBLIC_ADDRESSES" | cut -d/ -f1 | while read _IP; do
+(cat /etc/sysconfig/ctdb | egrep "^CTDB_NATGW_PUBLIC_IP" | sed -e "s/.*=//" -e "s/\/.*//";cat "$CTDB_PUBLIC_ADDRESSES" | cut -d/ -f1) | while read _IP; do
        _IP_HELD=`/sbin/ip addr show | grep "inet $_IP/"`
        [ -z "$_IP_HELD" ] || {
                _IFACE=`echo $_IP_HELD | sed -e "s/.*\s//"`