mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2026-09-21 15:58:28 +00: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:
@@ -2,5 +2,8 @@
|
|||||||
|
|
||||||
set -eu
|
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
|
chmod 600 $HOME/.ssh/known_hosts
|
||||||
|
|||||||
Reference in New Issue
Block a user