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