Fix invalid use of return value

This commit is contained in:
Philippe Vaucher
2016-04-01 17:14:39 +02:00
parent 20c60949de
commit 55c54a5abd

View File

@ -66,7 +66,7 @@ wait_for_wrapper()
while [[ $# -gt 0 ]] while [[ $# -gt 0 ]]
do do
case "$1" in case "$1" in
*:* ) *:* )
hostport=(${1//:/ }) hostport=(${1//:/ })
HOST=${hostport[0]} HOST=${hostport[0]}
PORT=${hostport[1]} PORT=${hostport[1]}
@ -84,12 +84,12 @@ do
STRICT=1 STRICT=1
shift 1 shift 1
;; ;;
-h) -h)
HOST="$2" HOST="$2"
if [[ $HOST == "" ]]; then break; fi if [[ $HOST == "" ]]; then break; fi
shift 2 shift 2
;; ;;
--host=*) --host=*)
HOST="${1#*=}" HOST="${1#*=}"
shift 1 shift 1
;; ;;
@ -137,14 +137,16 @@ CHILD=${CHILD:-0}
QUIET=${QUIET:-0} QUIET=${QUIET:-0}
if [[ $CHILD -gt 0 ]]; then if [[ $CHILD -gt 0 ]]; then
RESULT=$(wait_for) wait_for
RESULT=$?
exit $RESULT exit $RESULT
else else
if [[ $TIMEOUT -gt 0 ]]; then if [[ $TIMEOUT -gt 0 ]]; then
wait_for_wrapper wait_for_wrapper
RESULT=$? RESULT=$?
else else
RESULT=$(wait_for) wait_for
RESULT=$?
fi fi
fi fi