summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-05-14 12:23:55 +0200
committerlassulus <lass@aidsballs.de>2015-05-14 12:23:55 +0200
commit0358f6cd6c5b4eb94ee804bfad47f07e0a6e661c (patch)
tree2265e38888e3ccf6a0e2b2327f70396a81439194
parenta88b30dc20c590774fd7665dfc5d023f61dd4892 (diff)
util/bin: add 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
+