ctdb-scripts: Clarify logic for success of interface monitoring
[obnox/samba/samba-obnox.git] / ctdb / config / events.d / 10.interface
index 7445200b3287014db9034b9a64f7ad94344324c7..0cd11123f1dff889a061499e2177ce650dffb832 100755 (executable)
@@ -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