diff options
-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 |