config/11.natgw: use delete_ip_from_iface() instead of remove_ip()
authorStefan Metzmacher <metze@samba.org>
Fri, 12 Feb 2010 09:33:54 +0000 (10:33 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 23 Feb 2010 09:38:48 +0000 (10:38 +0100)
This also initializes the variables correctly for the
shutdown|removenatgw code path to delete_all.

metze

config/events.d/11.natgw

index ce1becc072fd4f4d2121a1f570dd7edf4f09a19d..18db3dee9987fa09d05cd0d53d34730d774c88eb 100644 (file)
@@ -11,8 +11,11 @@ loadconfig
 [ -z "$CTDB_NATGW_PUBLIC_IFACE" ] && exit 0
 
 delete_all() {
-       remove_ip $CTDB_NATGW_PUBLIC_IP $CTDB_NATGW_PUBLIC_IFACE
-       remove_ip $CTDB_NATGW_PUBLIC_IP_HOST lo
+       local _ip=`echo $CTDB_NATGW_PUBLIC_IP | cut -d '/' -f1`
+       local _maskbits=`echo $CTDB_NATGW_PUBLIC_IP | cut -d '/' -f2`
+
+       delete_ip_from_iface $CTDB_NATGW_PUBLIC_IFACE $_ip $_maskbits
+       delete_ip_from_iface lo $_ip 32
 
        ip route del 0.0.0.0/0 metric 10 >/dev/null 2>/dev/null