ssh-fwd : changement de la pipeline pour checker l'existence de la

redirection
This commit is contained in:
Hippolyte Chauvin 2023-11-11 16:56:32 +01:00
parent fcdfc805a2
commit f1395291d7

View file

@ -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