mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2025-12-19 11:12:18 +01:00
fix: only attempt to create file if it doesn't exist yet
On self-hosted runners it can happen that an action (docker container) is cached, resulting in aborting this script because the know_hosts file already exists. This if clause fixes it. Setting permissions is intentionally outside the if clause because in all cases we want to reset perms.
This commit is contained in:
parent
400135b4a7
commit
1002e5f311
1 changed files with 4 additions and 1 deletions
|
|
@ -2,5 +2,8 @@
|
|||
|
||||
set -eu
|
||||
|
||||
touch $HOME/.ssh/known_hosts
|
||||
if [ ! -f "$HOME/.ssh/known_hosts" ]; then
|
||||
touch $HOME/.ssh/known_hosts
|
||||
fi
|
||||
|
||||
chmod 600 $HOME/.ssh/known_hosts
|
||||
|
|
|
|||
Loading…
Reference in a new issue