]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-scripts: Avoid shellcheck warning SC2015 (A && B || C)
authorMartin Schwenke <martin@meltin.net>
Wed, 6 Jul 2016 10:40:23 +0000 (20:40 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 21 Jul 2016 00:24:26 +0000 (02:24 +0200)
SC2015: Note that A && B || C is not if-then-else. C may run when A is
true.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/config/ctdb.init

index 83c1493c13021a4cd8ce69b96c03818bb7bafbb2..f7ba95ced69de58f5674718624f2e02fedf5934d 100755 (executable)
@@ -95,6 +95,9 @@ stop()
        redhat)
            "$ctdbd_wrapper" "$pidfile" "stop"
            RETVAL=$?
+           # Common idiom in Red Hat init scripts - success() always
+           # succeeds so this does behave like if-then-else
+           # shellcheck disable=SC2015
             [ $RETVAL -eq 0 ] && success || failure
            echo ""
            [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ctdb