l: add untilport
This commit is contained in:
parent
0fd95b3228
commit
3fea8d651f
@ -112,6 +112,7 @@ with config.krebs.lib;
|
||||
#neat utils
|
||||
krebspaste
|
||||
psmisc
|
||||
untilport
|
||||
|
||||
#unpack stuff
|
||||
p7zip
|
||||
|
@ -10,6 +10,7 @@
|
||||
};
|
||||
mk_sql_pair = pkgs.callPackage ./mk_sql_pair/default.nix {};
|
||||
mpv-poll = pkgs.callPackage ./mpv-poll/default.nix {};
|
||||
untilport = pkgs.callPackage ./untilport/default.nix {};
|
||||
urban = pkgs.callPackage ./urban/default.nix {};
|
||||
xmonad-lass =
|
||||
let src = pkgs.writeNixFromCabal "xmonad-lass.nix" ./xmonad-lass; in
|
||||
|
18
lass/5pkgs/untilport/default.nix
Normal file
18
lass/5pkgs/untilport/default.nix
Normal file
@ -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
|
||||
''
|
Loading…
Reference in New Issue
Block a user