summaryrefslogtreecommitdiffstats
path: root/util/bin/untilport
diff options
context:
space:
mode:
Diffstat (limited to 'util/bin/untilport')
-rwxr-xr-xutil/bin/untilport15
1 files changed, 15 insertions, 0 deletions
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
+