summaryrefslogtreecommitdiff
path: root/accounts
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-12-08 16:01:16 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2021-12-08 16:01:16 +0100
commita7029ec67b4b496f4cd1c3805b2adcdd1889e11b (patch)
tree403126d79ef3e9307fdf952ac9acd82011f04fed /accounts
parent1c787d587829a10b3169567125e6b3657167145f (diff)
downloadnixos-a7029ec67b4b496f4cd1c3805b2adcdd1889e11b.tar
nixos-a7029ec67b4b496f4cd1c3805b2adcdd1889e11b.tar.gz
nixos-a7029ec67b4b496f4cd1c3805b2adcdd1889e11b.tar.bz2
nixos-a7029ec67b4b496f4cd1c3805b2adcdd1889e11b.tar.xz
nixos-a7029ec67b4b496f4cd1c3805b2adcdd1889e11b.zip
gkleen@sif: ssh proxy: lsof
Diffstat (limited to 'accounts')
-rw-r--r--accounts/gkleen@sif/systemd.nix7
1 files changed, 6 insertions, 1 deletions
diff --git a/accounts/gkleen@sif/systemd.nix b/accounts/gkleen@sif/systemd.nix
index eff9aa5e..de28895e 100644
--- a/accounts/gkleen@sif/systemd.nix
+++ b/accounts/gkleen@sif/systemd.nix
@@ -24,10 +24,15 @@ let
24 pid=$! 24 pid=$!
25 ${pkgs.systemd}/bin/systemd-notify --pid="''${pid}" 25 ${pkgs.systemd}/bin/systemd-notify --pid="''${pid}"
26 26
27 while ! ${pkgs.netcat-openbsd.nc}/bin/nc -z -v localhost ''${port}; do 27 check_pid() {
28 ${pkgs.lsof}/bin/lsof -Pi @localhost:"''${port}" -sTCP:LISTEN -t
29 }
30
31 while ! check_pid; do
28 ${pkgs.coreutils}/bin/sleep 0.1 32 ${pkgs.coreutils}/bin/sleep 0.1
29 done 33 done
30 34
35 ${pkgs.systemd}/bin/systemd-notify --pid=$(check_pid)
31 ${pkgs.systemd}/bin/systemd-notify --ready 36 ${pkgs.systemd}/bin/systemd-notify --ready
32 37
33 wait "''${pid}" 38 wait "''${pid}"