From 5b120ed3530882228a224d6609c4cf550cf71eef Mon Sep 17 00:00:00 2001 From: f Date: Sat, 20 May 2023 12:26:41 -0300 Subject: [PATCH] fix: create the file if it doesn't exist --- backup.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backup.sh b/backup.sh index 4ab31f4..3988909 100755 --- a/backup.sh +++ b/backup.sh @@ -23,6 +23,8 @@ if ! grep -q "${SSH_ALIAS}" /root/.ssh/config ; then echo " User ${SSH_USER}" >> /root/.ssh/config fi +touch /root/.ssh/known_hosts + if ! ssh-keygen -F "[${SSH_SERVER}]:${SSH_PORT}"; then echo "${SSH_KNOWN_HOSTS}" >> /root/.ssh/known_hosts fi