From 8655cb290b91b6a12c2c0cd43630c32cc02512b0 Mon Sep 17 00:00:00 2001 From: denizs Date: Fri, 28 Feb 2020 13:02:13 +0100 Subject: [PATCH] exit with error message if netcat not installed --- wait-for | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wait-for b/wait-for index ddfc39e..9403bbd 100755 --- a/wait-for +++ b/wait-for @@ -20,9 +20,10 @@ USAGE } wait_for() { + type nc > /dev/null 2>&1 || { echo >&2 "wait-for requires nc to be installed. Aborting."; exit 1; } for i in `seq $TIMEOUT` ; do nc -z "$HOST" "$PORT" > /dev/null 2>&1 - + result=$? if [ $result -eq 0 ] ; then if [ $# -gt 0 ] ; then