From 55c54a5abdfb32637b563b28cc088314b162195e Mon Sep 17 00:00:00 2001 From: Philippe Vaucher Date: Fri, 1 Apr 2016 17:14:39 +0200 Subject: [PATCH] Fix invalid use of return value --- wait-for-it.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/wait-for-it.sh b/wait-for-it.sh index 3f80029..eca6c3b 100755 --- a/wait-for-it.sh +++ b/wait-for-it.sh @@ -66,7 +66,7 @@ wait_for_wrapper() while [[ $# -gt 0 ]] do case "$1" in - *:* ) + *:* ) hostport=(${1//:/ }) HOST=${hostport[0]} PORT=${hostport[1]} @@ -84,12 +84,12 @@ do STRICT=1 shift 1 ;; - -h) + -h) HOST="$2" if [[ $HOST == "" ]]; then break; fi shift 2 ;; - --host=*) + --host=*) HOST="${1#*=}" shift 1 ;; @@ -137,14 +137,16 @@ CHILD=${CHILD:-0} QUIET=${QUIET:-0} if [[ $CHILD -gt 0 ]]; then - RESULT=$(wait_for) + wait_for + RESULT=$? exit $RESULT else if [[ $TIMEOUT -gt 0 ]]; then wait_for_wrapper RESULT=$? else - RESULT=$(wait_for) + wait_for + RESULT=$? fi fi