summaryrefslogtreecommitdiff
path: root/backup.in
diff options
context:
space:
mode:
Diffstat (limited to 'backup.in')
-rwxr-xr-xbackup.in17
1 files changed, 16 insertions, 1 deletions
diff --git a/backup.in b/backup.in
index eeafcdd..e8caa03 100755
--- a/backup.in
+++ b/backup.in
@@ -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