summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2017-07-13 12:58:33 +1000
committerAmitay Isaacs <amitay@samba.org>2017-08-14 05:15:25 +0200
commit2b0e266d07cf62c1cbbda182aae6cdc93777cb3b (patch)
treeca76f419e5da7bd8f19c014847559e7fc5935a10 /ctdb
parentaa12ea77937b17c2c84cd5fce94f946d0e55f91f (diff)
downloadsamba-2b0e266d07cf62c1cbbda182aae6cdc93777cb3b.tar.gz
ctdb-tools: Avoid shellcheck SC2181 warnings (use of $?) in onnode
Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/tools/onnode16
1 files changed, 6 insertions, 10 deletions
diff --git a/ctdb/tools/onnode b/ctdb/tools/onnode
index ac4f6ba96b1..0b31a826c6f 100755
--- a/ctdb/tools/onnode
+++ b/ctdb/tools/onnode
@@ -238,10 +238,9 @@ get_nodes ()
all_nodes=$(sed -e 's@#.*@@g' -e 's@ *@@g' -e 's@^$@#DEAD@' "$f")
fi
- local nodes=""
- local n
- for n in $(parse_nodespec "$1") ; do
- [ $? != 0 ] && exit 1 # Required to catch exit in above subshell.
+ local n nodes
+ nodes=$(parse_nodespec "$1") || exit $?
+ for n in $nodes ; do
case "$n" in
all)
echo "${all_nodes//#DEAD/}"
@@ -337,8 +336,7 @@ fi
######################################################################
-nodes=$(get_nodes "$nodespec")
-[ $? != 0 ] && exit 1 # Required to catch exit in above subshell.
+nodes=$(get_nodes "$nodespec") || exit $?
if $quiet ; then
verbose=false
@@ -386,15 +384,13 @@ for n in $nodes ; do
$SSH $ssh_opts $EXTRA_SSH_OPTS "$n" "$command" |
stdout_filter >&3
} 2>&1 | stderr_filter
- }
- [ $? = 0 ] || retcode=$?
+ } || retcode=$?
fi
done
if $parallel ; then
for p in $pids; do
- wait "$p"
- [ $? = 0 ] || retcode=$?
+ wait "$p" || retcode=$?
done
fi