Loading .shell/lib/ssh.sh +9 −3 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ make_config() { cat ~/.ssh/config ~/.ssh/config.local 2>/dev/null | awk >"$SSH_CONFIG" " function remove_line() { sub(/^/, \"\#\"); } /^$/ || /^#/ { print \$0; next } /^$/ || /^#[^@]/ { print \$0; next } `rule_match` `rule_unix_sockets` Loading Loading @@ -74,9 +74,14 @@ rule_match() { [ $SSH_MAJOR -eq 6 ] && [ $SSH_MINOR -ge 5 ] && return cat <<-'END_AWK' BEGIN { is_match=0 } BEGIN { is_match=0; match_fallback=false } match($1, /^#@fallback:$/) { sub(/.*#@fallback:[[:space:]]*/, "") match_fallback=$0 next } match($1, /^Match$/) { if ( match($0, /#default:[[:space:]]*match-all/) ) { if ( ! system(match_fallback) ) { sub(/^.*$/, "Host *") } else { is_match=1 Loading @@ -84,6 +89,7 @@ rule_match() { } match($1, /^Host$/) { is_match=0 } is_match { remove_line() } !match($1, /^#fallback:$/) { match_fallback=false } END_AWK } Loading .ssh/config +2 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,8 @@ Host 192.168.* 10.* *.lan *.local localhost ## REQUIRES: (Match exec) 6.5 ## REQUIRES: (ControlMaster, ControlPath) 3.9 ## REQUIRES: (ControlPersist) 5.6 Match exec "test ${PLATFORM:-unknown} != windows" #default: match-all #@fallback: test ${PLATFORM:-unknown} != windows Match exec "test ${PLATFORM:-unknown} != windows" ControlMaster auto ControlPath %d/.ssh/socks:%l/%r@%h:%p ControlPersist 2h Loading Loading
.shell/lib/ssh.sh +9 −3 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ make_config() { cat ~/.ssh/config ~/.ssh/config.local 2>/dev/null | awk >"$SSH_CONFIG" " function remove_line() { sub(/^/, \"\#\"); } /^$/ || /^#/ { print \$0; next } /^$/ || /^#[^@]/ { print \$0; next } `rule_match` `rule_unix_sockets` Loading Loading @@ -74,9 +74,14 @@ rule_match() { [ $SSH_MAJOR -eq 6 ] && [ $SSH_MINOR -ge 5 ] && return cat <<-'END_AWK' BEGIN { is_match=0 } BEGIN { is_match=0; match_fallback=false } match($1, /^#@fallback:$/) { sub(/.*#@fallback:[[:space:]]*/, "") match_fallback=$0 next } match($1, /^Match$/) { if ( match($0, /#default:[[:space:]]*match-all/) ) { if ( ! system(match_fallback) ) { sub(/^.*$/, "Host *") } else { is_match=1 Loading @@ -84,6 +89,7 @@ rule_match() { } match($1, /^Host$/) { is_match=0 } is_match { remove_line() } !match($1, /^#fallback:$/) { match_fallback=false } END_AWK } Loading
.ssh/config +2 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,8 @@ Host 192.168.* 10.* *.lan *.local localhost ## REQUIRES: (Match exec) 6.5 ## REQUIRES: (ControlMaster, ControlPath) 3.9 ## REQUIRES: (ControlPersist) 5.6 Match exec "test ${PLATFORM:-unknown} != windows" #default: match-all #@fallback: test ${PLATFORM:-unknown} != windows Match exec "test ${PLATFORM:-unknown} != windows" ControlMaster auto ControlPath %d/.ssh/socks:%l/%r@%h:%p ControlPersist 2h Loading