mirror of
https://github.com/Burnett01/rsync-deployments.git
synced 2025-12-19 11:12:18 +01:00
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.
9 lines
133 B
Bash
Executable file
9 lines
133 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
if [ ! -f "$HOME/.ssh/known_hosts" ]; then
|
|
touch $HOME/.ssh/known_hosts
|
|
fi
|
|
|
|
chmod 600 $HOME/.ssh/known_hosts
|