summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/untilport/default.nix
diff options
context:
space:
mode:
authorlassulus <lass@lassul.us>2017-04-24 11:43:48 +0200
committerlassulus <lass@lassul.us>2017-04-24 11:43:48 +0200
commitab7a5a507e910a3a9d2343cddf082417f71b225f (patch)
treeeb889264ef1342174cdec607f199366836df2564 /krebs/5pkgs/untilport/default.nix
parent96a49430c10ae6f3086b4e3fd16bf73d77bd9188 (diff)
move untilport: l/5 -> k/5
Diffstat (limited to 'krebs/5pkgs/untilport/default.nix')
-rw-r--r--krebs/5pkgs/untilport/default.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/krebs/5pkgs/untilport/default.nix b/krebs/5pkgs/untilport/default.nix
new file mode 100644
index 000000000..61bcc2b89
--- /dev/null
+++ b/krebs/5pkgs/untilport/default.nix
@@ -0,0 +1,18 @@
+{ pkgs, ... }:
+
+pkgs.writeDashBin "untilport" ''
+ 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 ${pkgs.netcat-openbsd}/bin/nc -z "$@"; do sleep 1; done
+ fi
+''