From 0358f6cd6c5b4eb94ee804bfad47f07e0a6e661c Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 14 May 2015 12:23:55 +0200 Subject: util/bin: add untilport --- util/bin/untilport | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 util/bin/untilport diff --git a/util/bin/untilport b/util/bin/untilport new file mode 100755 index 00000000..b815cb19 --- /dev/null +++ b/util/bin/untilport @@ -0,0 +1,15 @@ +#!/bin/sh +set -euf + +usage() { + echo 'untiport $target $port' + echo 'Sleeps until the destinated port is reachable.' + echo 'ex: untilport google.de 80 && echo 'google is now reachable'' +} + +if [ $# -ne 2 ]; then + usage +else + until nc -z "$@"; do sleep 1; done +fi + -- cgit v1.2.3