From 4a84909a501a0220d52c447dde54d6d21ef245f9 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 2 Jun 2010 09:13:58 -0700 Subject: fix for bug 5134 * don't try to delete non-existent IP resource --- scripts/ocf-IPaddr2-vyatta | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts') diff --git a/scripts/ocf-IPaddr2-vyatta b/scripts/ocf-IPaddr2-vyatta index 082b84f..0c1472c 100755 --- a/scripts/ocf-IPaddr2-vyatta +++ b/scripts/ocf-IPaddr2-vyatta @@ -365,6 +365,14 @@ delete_interface () { iface="$2" netmask="$3" + local sout=$($IP2UTIL -o -f inet addr show dev "$iface" 2>/dev/null \ + | grep " $ipaddr/$netmask ") + if [ -z "$sout" ]; then + # IP/mask is not on the interface. nothing to do. + ocf_log info "$ipaddr/$netmask not on $iface. Nothing to delete." + return 0 + fi + CMD="$IP2UTIL -f inet addr delete $ipaddr/$netmask dev $iface" ocf_log info "$CMD" -- cgit v1.2.3