diff options
Diffstat (limited to 'get-host-keys')
-rwxr-xr-x | get-host-keys | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/get-host-keys b/get-host-keys index e67830d..896d983 100755 --- a/get-host-keys +++ b/get-host-keys | |||
@@ -77,15 +77,22 @@ else | |||
77 | dnsname_to_openssh_knownhost "${host##*@}" >> ssh_known_hosts || die "could not validate hostname cryptographically" | 77 | dnsname_to_openssh_knownhost "${host##*@}" >> ssh_known_hosts || die "could not validate hostname cryptographically" |
78 | fi | 78 | fi |
79 | 79 | ||
80 | ssh \ | 80 | modify_known_hosts=y |
81 | -F /dev/null \ | 81 | |
82 | -o GlobalKnownHostsFile=$PWD/ssh_known_hosts \ | 82 | set -- ssh |
83 | -o UserKnownHostsFile=$PWD/ssh_known_hosts \ | 83 | if [ ! "$modify_known_hosts" ] |
84 | -o UpdateHostKeys=yes \ | 84 | then |
85 | -o PasswordAuthentication=no \ | 85 | set -- "$@" -F /dev/null |
86 | -o StrictHostKeyChecking=yes \ | 86 | set -- "$@" -o GlobalKnownHostsFile=$PWD/ssh_known_hosts |
87 | -n -T \ | 87 | set -- "$@" -o UserKnownHostsFile=$PWD/ssh_known_hosts |
88 | "$host" >/dev/null 2>&1 || true | 88 | fi |
89 | set -- "$@" -o UpdateHostKeys=yes | ||
90 | set -- "$@" -o PasswordAuthentication=no | ||
91 | set -- "$@" -o StrictHostKeyChecking=yes | ||
92 | set -- "$@" -n -T | ||
93 | set -- "$@" "$host" | ||
94 | |||
95 | "$@" || true | ||
89 | 96 | ||
90 | if test -t 1 | 97 | if test -t 1 |
91 | then | 98 | then |