From ab7a5a507e910a3a9d2343cddf082417f71b225f Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 24 Apr 2017 11:43:48 +0200 Subject: move untilport: l/5 -> k/5 --- krebs/5pkgs/untilport/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 krebs/5pkgs/untilport/default.nix (limited to 'krebs/5pkgs') 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 +'' -- cgit v1.2.3