summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <austin@netdata.cloud>2021-03-31 07:20:43 -0400
committerGitHub <noreply@github.com>2021-03-31 07:20:43 -0400
commita843b893210587ffeb91bdbf866779555b755596 (patch)
treeea35cf919451eace7c4cbf510106862ddc4d17d2
parent4c34788d51646f1f41bcb663e9df5731ee5024cc (diff)
Properly handle different netcat command names. (#10883)
-rwxr-xr-xpackaging/scripts/test.sh11
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"