From dc5cad75cf872172df2d0bf8f3df8ad7a034e5c2 Mon Sep 17 00:00:00 2001 From: JocelynDelalande Date: Sun, 13 Jan 2019 00:47:53 +0100 Subject: [PATCH] [ehn] Test hostkey presence a more reliable way --- conf/backup_method.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/backup_method.j2 b/conf/backup_method.j2 index dedbdb0..7eef826 100644 --- a/conf/backup_method.j2 +++ b/conf/backup_method.j2 @@ -3,7 +3,7 @@ set -e BORG_PASSPHRASE="{{ passphrase }}" -if grep "{{ server }}" ~/.ssh/known_hosts; then +if ssh-keygen -F "{{ server }}" >/dev/null ; then BORG_RSH="ssh -i /root/.ssh/id_{{ app }}_ed25519 -oStrictHostKeyChecking=yes " else BORG_RSH="ssh -i /root/.ssh/id_{{ app }}_ed25519 -oStrictHostKeyChecking=no "