Skip to content
Snippets Groups Projects
Commit f7afac2c authored by nimrod's avatar nimrod
Browse files

No need to check for already forwarded ports.

parent e401217b
No related branches found
No related tags found
No related merge requests found
...@@ -9,8 +9,5 @@ host="$1" || { usage >> /dev/stderr; exit 1; } ...@@ -9,8 +9,5 @@ host="$1" || { usage >> /dev/stderr; exit 1; }
forward="$2" || { usage >> /dev/stderr; exit 1; } forward="$2" || { usage >> /dev/stderr; exit 1; }
alias ssh='ssh -fnNTS ~/.ssh/%C.sock' alias ssh='ssh -fnNTS ~/.ssh/%C.sock'
if ! ssh -O check -L "$forward" "$host"
then
ssh -o ControlMaster=auto -o ControlPersist=0 -o ExitOnForwardFailure=no -o ControlPersist=0 "$host" ssh -o ControlMaster=auto -o ControlPersist=0 -o ExitOnForwardFailure=no -o ControlPersist=0 "$host"
ssh -O forward -L "$forward" "$host" ssh -O forward -L "$forward" "$host"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment