From: Martin Schwenke Date: Wed, 16 Dec 2015 08:18:49 +0000 (+1100) Subject: ctdb-scripts: Clarify logic for success of interface monitoring X-Git-Url: http://git.samba.org/?p=obnox%2Fsamba%2Fsamba-obnox.git;a=commitdiff_plain;h=c23744c61db321a911653d58ed258a3003cf798b 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 --- diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface index 7445200b328..0cd11123f1d 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