From: Martin Schwenke Date: Wed, 6 Jul 2016 10:40:23 +0000 (+1000) Subject: ctdb-scripts: Avoid shellcheck warning SC2015 (A && B || C) X-Git-Tag: tdb-1.3.10~265 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b0c1dbfb8f2bd2743b21a6a77343b2a7940958ce;p=thirdparty%2Fsamba.git ctdb-scripts: Avoid shellcheck warning SC2015 (A && B || C) SC2015: Note that A && B || C is not if-then-else. C may run when A is true. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/ctdb.init b/ctdb/config/ctdb.init index 83c1493c130..f7ba95ced69 100755 --- a/ctdb/config/ctdb.init +++ b/ctdb/config/ctdb.init @@ -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