Skip to content

Commit

Permalink
ctdb-scripts: Avoid shellcheck warning SC2015 (A && B || C)
Browse files Browse the repository at this point in the history
SC2015: Note that A && B || C is not if-then-else. C may run when A is
true.

Signed-off-by: Martin Schwenke <[email protected]>
Reviewed-by: Amitay Isaacs <[email protected]>
  • Loading branch information
martin-schwenke authored and Amitay Isaacs committed Jul 21, 2016
1 parent 987fd07 commit b0c1dbf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ctdb/config/ctdb.init
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b0c1dbf

Please sign in to comment.