From bf93671a6d5dd56cf3a6d3373008af1c15c92709 Mon Sep 17 00:00:00 2001 From: Matt Hardcastle Date: Sat, 29 Aug 2020 16:22:29 -0700 Subject: [PATCH] Deduplicate hosts in ssh-tunnel The ssh-tunnel plugin prints a host every time it finds a line with DynamicForward or LocalForward. This change condenses consecutive duplicate hosts to ensure only one host is displayed in the menu, even if that host configuration has multiple forwards configured. --- Network/ssh-tunnel.1s.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Network/ssh-tunnel.1s.sh b/Network/ssh-tunnel.1s.sh index c339f8772..feea240de 100755 --- a/Network/ssh-tunnel.1s.sh +++ b/Network/ssh-tunnel.1s.sh @@ -31,7 +31,7 @@ function hosts() { $1 == "DynamicForward" || $1 == "LocalForward" { print host; } - ' "$1" + ' "$1" | uniq } for h in $(hosts ~/.ssh/config); do