diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-06-02 09:13:58 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-06-02 09:13:58 -0700 |
commit | 4a84909a501a0220d52c447dde54d6d21ef245f9 (patch) | |
tree | 4c3c7681e2d361bb66d4d92e9406b7150abf050b /scripts/ocf-IPaddr2-vyatta | |
parent | b816b0a8d7933740e7a7297f56d4427c0bed003d (diff) | |
download | vyatta-cluster-4a84909a501a0220d52c447dde54d6d21ef245f9.tar.gz vyatta-cluster-4a84909a501a0220d52c447dde54d6d21ef245f9.zip |
fix for bug 5134
* don't try to delete non-existent IP resource
Diffstat (limited to 'scripts/ocf-IPaddr2-vyatta')
-rwxr-xr-x | scripts/ocf-IPaddr2-vyatta | 8 |
1 files changed, 8 insertions, 0 deletions
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" |