In the example script to remove all ip addresses after a ctdb crash,
[sahlberg/ctdb.git] / 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//"`