Loading .shell/lib/ssh.sh +16 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ make_config() { `rule_mux` `rule_mux_persist` `rule_canonisation` `rule_percent_C` `rule_include` 1 Loading Loading @@ -123,6 +124,21 @@ rule_canonisation() { echo 'match($1, /^Canonical/) { remove_line() }' } rule_percent_C() { # %C requires >=6.7 [ $SSH_MAJOR -gt 6 ] && return [ $SSH_MAJOR -eq 6 ] && [ $SSH_MINOR -ge 7 ] && return cat <<-'END_AWK' match($1, /^(ControlPath|LocalCommand)/) { # Temporarily encode %% as the invalid line-feed character to # prevent accidental replacement of "%%C" with "%%l:%r@%h:%p" gsub(/%%/, "\n") gsub(/%C/, "%l:%r@%h:%p") gsub(/\n/, "%%") } END_AWK } rule_include() { # Include requires >=7.2 # If including config.local, remove as it is concatenated by this script Loading .ssh/config +2 −1 Original line number Diff line number Diff line Loading @@ -37,10 +37,11 @@ Host 192.168.* 10.* *.lan *.local localhost ## REQUIRES: (Match exec) 6.5 ## REQUIRES: (ControlMaster, ControlPath) 3.9 ## REQUIRES: (ControlPersist) 5.6 ## REQUIRES: (%C) 6.7 #@fallback: test ${PLATFORM:-unknown} != windows Match exec "test ${PLATFORM:-unknown} != windows" ControlMaster auto ControlPath ~/.ssh/%l:%r@%h:%p ControlPath ~/.ssh/%C.sock ControlPersist 2h # === Local Includes === Loading Loading
.shell/lib/ssh.sh +16 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ make_config() { `rule_mux` `rule_mux_persist` `rule_canonisation` `rule_percent_C` `rule_include` 1 Loading Loading @@ -123,6 +124,21 @@ rule_canonisation() { echo 'match($1, /^Canonical/) { remove_line() }' } rule_percent_C() { # %C requires >=6.7 [ $SSH_MAJOR -gt 6 ] && return [ $SSH_MAJOR -eq 6 ] && [ $SSH_MINOR -ge 7 ] && return cat <<-'END_AWK' match($1, /^(ControlPath|LocalCommand)/) { # Temporarily encode %% as the invalid line-feed character to # prevent accidental replacement of "%%C" with "%%l:%r@%h:%p" gsub(/%%/, "\n") gsub(/%C/, "%l:%r@%h:%p") gsub(/\n/, "%%") } END_AWK } rule_include() { # Include requires >=7.2 # If including config.local, remove as it is concatenated by this script Loading
.ssh/config +2 −1 Original line number Diff line number Diff line Loading @@ -37,10 +37,11 @@ Host 192.168.* 10.* *.lan *.local localhost ## REQUIRES: (Match exec) 6.5 ## REQUIRES: (ControlMaster, ControlPath) 3.9 ## REQUIRES: (ControlPersist) 5.6 ## REQUIRES: (%C) 6.7 #@fallback: test ${PLATFORM:-unknown} != windows Match exec "test ${PLATFORM:-unknown} != windows" ControlMaster auto ControlPath ~/.ssh/%l:%r@%h:%p ControlPath ~/.ssh/%C.sock ControlPersist 2h # === Local Includes === Loading