add check for installed netcat

This commit is contained in:
Robert Kaussow 2020-02-03 16:08:25 +01:00
parent 39d6e2a18d
commit 450058159d
1 changed files with 6 additions and 1 deletions

View File

@ -22,7 +22,7 @@ USAGE
wait_for() {
for i in `seq $TIMEOUT` ; do
nc -z "$HOST" "$PORT" > /dev/null 2>&1
result=$?
if [ $result -eq 0 ] ; then
if [ $# -gt 0 ] ; then
@ -71,6 +71,11 @@ do
esac
done
if ! [ -x "$(command -v nc)" ]; then
echoerr "Error: netcat is required for wait-for to run."
exit 1
fi
if [ "$HOST" = "" -o "$PORT" = "" ]; then
echoerr "Error: you need to provide a host and port to test."
usage 2