Skip to content

Commit

Permalink
ctdb-scripts: Clarify logic for success of interface monitoring
Browse files Browse the repository at this point in the history
The current code uses so many shell idioms that it is difficult to
follow.

Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Michael Adam <[email protected]>
  • Loading branch information
martin-schwenke authored and obnoxxx committed Jan 12, 2016
1 parent d8e4c5a commit c23744c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ctdb/config/events.d/10.interface
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,16 @@ monitor_interfaces()

done

$fail || return 0

$up_interfaces_found && \
[ "$CTDB_PARTIALLY_ONLINE_INTERFACES" = "yes" ] && \
if $fail ; then
if $up_interfaces_found && \
[ "$CTDB_PARTIALLY_ONLINE_INTERFACES" = "yes" ] ; then
return 0
else
return 1
fi
else
return 0

return 1
fi
}

# Sets: iface, ip, maskbits, family
Expand Down

0 comments on commit c23744c

Please sign in to comment.