From f1395291d7825f43ff1e78a5b3af7e7865783d86 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Sat, 11 Nov 2023 16:56:32 +0100 Subject: [PATCH] ssh-fwd : changement de la pipeline pour checker l'existence de la redirection --- bin/ssh-fwd | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/ssh-fwd b/bin/ssh-fwd index 96b35ef..9e750b4 100755 --- a/bin/ssh-fwd +++ b/bin/ssh-fwd @@ -47,8 +47,7 @@ stop_forwarding() { is_forwarding_active() { lsof -i -P -n \ | awk '($1 == "ssh" && $10 == "(LISTEN)") { print $9 }' \ - | cut -d : -f 2 \ - | grep -q "$local_port" + | sed 's/.*://' | sort | uniq | grep -q "$local_port" } # Branchement principal