diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2021-03-31 07:20:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-31 07:20:43 -0400 |
commit | a843b893210587ffeb91bdbf866779555b755596 (patch) | |
tree | ea35cf919451eace7c4cbf510106862ddc4d17d2 | |
parent | 4c34788d51646f1f41bcb663e9df5731ee5024cc (diff) |
Properly handle different netcat command names. (#10883)
-rwxr-xr-x | packaging/scripts/test.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packaging/scripts/test.sh b/packaging/scripts/test.sh index bae664d334..c390826227 100755 --- a/packaging/scripts/test.sh +++ b/packaging/scripts/test.sh @@ -12,12 +12,21 @@ wait_for() { name="${3}" timeout="30" + if command -v nc > /dev/null ; then + netcat="nc" + elif command -v netcat > /dev/null ; then + netcat="netcat" + else + printf "Unable to find a usable netcat command.\n" + return 1 + fi + printf "Waiting for %s on %s:%s ... " "${name}" "${host}" "${port}" sleep 30 i=0 - while ! nc -z "${host}" "${port}"; do + while ! ${netcat} -z "${host}" "${port}"; do sleep 1 if [ "$i" -gt "$timeout" ]; then printf "Timed out!\n" |