diff options
author | Erich Eckner <git@eckner.net> | 2019-03-29 11:52:37 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-03-29 11:52:37 +0100 |
commit | b687946d96ce942fb2cc2745ee6d4a089af4eb98 (patch) | |
tree | f0559345f652ea1754ddde53765659339920bfb4 | |
parent | 058bd5bd5ad282d23817ecf8b340c45a8230029e (diff) | |
download | hardlinkedBackups-b687946d96ce942fb2cc2745ee6d4a089af4eb98.tar.xz |
backup.in: honor ipv4/6 preference set in .ssh/config
-rwxr-xr-x | backup.in | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -52,7 +52,22 @@ extract_ssh_ip_protocols() { t d ' \ - | sort -u + | sort -u \ + | if [ -f ~/.ssh/config ]; then + grep -vxF "$( + sed ' + /^Host\s\+'"$1"'$/,/^Host\s/ { + s/^\s*AddressFamily\s\+inet\s*$/6/ + t + s/^\s*AddressFamily\s\+inet6\s*$/4/ + t + } + d + ' ~/.ssh/config + )" + else + cat + fi } if [ $# -eq 1 ]; then |