diff options
author | Christian Pointner <equinox@spreadspace.org> | 2017-12-13 00:16:24 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2017-12-13 00:16:24 +0100 |
commit | 66de6e08c414ada9111d8241a6ef5d844c3527bf (patch) | |
tree | e0eff089137c8071dd01c7cbeee96f54ebb728bb /remove-known-host.sh | |
parent | limit tftp server to vm bridge (diff) |
added workaround for new key detection
Diffstat (limited to 'remove-known-host.sh')
-rwxr-xr-x | remove-known-host.sh | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/remove-known-host.sh b/remove-known-host.sh index d681f0e6..d2c8b8d5 100755 --- a/remove-known-host.sh +++ b/remove-known-host.sh @@ -5,24 +5,10 @@ if [ -z "$1" ]; then exit 1 fi -TMP=`host -t A "$1" | grep -v "has no"` -IP=`echo "$TMP" | awk '{ print($4) }'` -HOST=`echo "$TMP" | awk '{ print($1) }'` - -TMP=`host -t AAAA "$1" | grep -v "has no"` -IP6=`echo "$TMP" | awk '{ print($5) }'` -HOST6=`echo "$TMP" | awk '{ print($1) }'` - -if [ "$HOST6" = "$HOST" ]; then - HOST6="" -fi SHORT="$1" -if [ "$SHORT" = "$HOST" ] || [ "$SHORT" == "$HOST6" ]; then - SHORT="" -fi - +SSH_HOST=$(ssh -G "$1" | grep "^hostname " | awk '{ print($2) }' ) -for name in $IP $IP6 $HOST $HOST6 $SHORT; do +for name in $SHORT $SSH_HOST; do ssh-keygen -f "$HOME/.ssh/known_hosts" -R "$name" done |