diff options
author | Martin Schwenke <martin@meltin.net> | 2014-03-14 13:14:18 +1100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2014-03-23 04:20:14 +0100 |
commit | 058e14cdb0b6eb2e999dca599961ae6734105f99 (patch) | |
tree | 61b30daf94ba3e7cc48cb95182d49a30848ef753 /ctdb | |
parent | ecafbce1b1cf53ae8c3de9eb5201192f7fe1f67d (diff) | |
download | samba-058e14cdb0b6eb2e999dca599961ae6734105f99.tar.gz samba-058e14cdb0b6eb2e999dca599961ae6734105f99.tar.xz samba-058e14cdb0b6eb2e999dca599961ae6734105f99.zip |
ctdb-eventscripts: Fix regression in IP add/delete functions
Commit 176ae6c704528c021fcc34a41878584f43a00119 caused these functions
to exit on failure. This is incorrect and broke NAT gateway.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rwxr-xr-x | ctdb/config/functions | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ctdb/config/functions b/ctdb/config/functions index 6efe60f0d34..6bc03126299 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -832,8 +832,10 @@ add_ip_to_iface () ip link set "$_iface" up || \ die "Failed to bringup interface $_iface" - ip addr add "$_ip/$_maskbits" brd + dev "$_iface" || \ - die "Failed to add $_ip/$_maskbits on dev $_iface" + ip addr add "$_ip/$_maskbits" brd + dev "$_iface" || { + echo "Failed to add $_ip/$_maskbits on dev $_iface" + return 1 + } } delete_ip_from_iface() @@ -849,8 +851,10 @@ delete_ip_from_iface() # remembering and re-adding secondaries. set_proc "sys/net/ipv4/conf/${_iface}/promote_secondaries" 1 - ip addr del "$_ip/$_maskbits" dev "$_iface" || \ - die "Failed to del $_ip on dev $_iface" + ip addr del "$_ip/$_maskbits" dev "$_iface" || { + echo "Failed to del $_ip on dev $_iface" + return 1 + } } # If the given IP is hosted then print 2 items: maskbits and iface |