From c23744c61db321a911653d58ed258a3003cf798b Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 16 Dec 2015 19:18:49 +1100 Subject: [PATCH] ctdb-scripts: Clarify logic for success of interface monitoring The current code uses so many shell idioms that it is difficult to follow. Signed-off-by: Martin Schwenke Reviewed-by: Michael Adam --- ctdb/config/events.d/10.interface | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface index 7445200b3287..0cd11123f1df 100755 --- a/ctdb/config/events.d/10.interface +++ b/ctdb/config/events.d/10.interface @@ -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