ctdb-scripts: further untangle logic for success of interface monitoring
[obnox/samba/samba-obnox.git] / ctdb / config / events.d / 10.interface
index 4b9f31c5a2b5d0b23b829b3fd8482c3c1cc1b11d..00b5f97d3e61aa441d2eba7e2b2f02e3bc336af7 100755 (executable)
@@ -152,16 +152,19 @@ monitor_interfaces()
 
        done
 
-       if $fail ; then
-           if $up_interfaces_found && \
-                   [ "$CTDB_PARTIALLY_ONLINE_INTERFACES" = "yes" ] ; then
+       if ! $fail ; then
                return 0
-           else
+       fi
+
+       if ! $up_interfaces_found ; then
+               return 1
+       fi
+
+       if [ "$CTDB_PARTIALLY_ONLINE_INTERFACES" != "yes" ]; then
                return 1
-           fi
-       else
-           return 0
        fi
+
+       return 0
 }
 
 # Sets: iface, ip, maskbits, family