summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-07-06 20:40:23 +1000
committerAmitay Isaacs <amitay@samba.org>2016-07-21 02:24:26 +0200
commitb0c1dbfb8f2bd2743b21a6a77343b2a7940958ce (patch)
tree0fd88965192d714cc1df310b343ae1530cf2a09c
parent987fd078d267a72ccddd6db2f197b8b30f52041e (diff)
downloadsamba-b0c1dbfb8f2bd2743b21a6a77343b2a7940958ce.tar.gz
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 <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rwxr-xr-xctdb/config/ctdb.init3
1 files changed, 3 insertions, 0 deletions
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