diff options
Diffstat (limited to 'util')
-rwxr-xr-x | util/bin/untilport | 15 |
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 + |