Skip to content

Commit

Permalink
Fix if statement to handle Bash Boolean checking correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
alallier committed Dec 18, 2020
1 parent d9b93e8 commit 913b6b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wait-for-it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fi

# see if timeout.c args have been updated in busybox v1.30.0 or newer
# note: this requires the use of bash on Alpine
if [[ $WAITFORIT_ISBUSY && $(busybox | head -1) =~ ^.*v([[:digit:]]+)\.([[:digit:]]+)\..+$ ]]; then
if [[ $WAITFORIT_ISBUSY -eq 1 && $(busybox | head -1) =~ ^.*v([[:digit:]]+)\.([[:digit:]]+)\..+$ ]]; then
if [[ ${BASH_REMATCH[1]} -le 1 && ${BASH_REMATCH[2]} -lt 30 ]]; then
# using pre 1.30.0 version with `-t SEC` arg
WAITFORIT_BUSYTIMEFLAG="-t"
Expand Down

0 comments on commit 913b6b3

Please sign in to comment.