Merge pull request 'Change how the SSH key is handled' (#2) from change-ssh-key-usage into main

Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
2025-10-22 00:31:13 +00:00

View File

@@ -4,14 +4,12 @@ set -euo pipefail
options="$1" options="$1"
ssh_port="$2" ssh_port="$2"
SSH_HOME="${HOME}/.ssh"
SSH_KEYPATH="${SSH_HOME}/deploy_key"
mkdir -p "$SSH_HOME" echo "$SSH_KEY" > deploy_key
echo "$SSH_KEY" > "$SSH_KEYPATH" chmod 400 deploy_key
chmod 600 "$SSH_KEYPATH"
echo "Deploying..." echo "Deploying..."
rsync $options \ rsync $options \
-e "ssh -p $ssh_port -i $SSH_KEYPATH -o StrictHostKeyChecking=no" \ -e "ssh -p $ssh_port -i deploy_key -o StrictHostKeyChecking=no" \
$RSYNC_SOURCE "$RSYNC_USERHOST":"$RSYNC_DESTINATION" $RSYNC_SOURCE "$RSYNC_USERHOST":"$RSYNC_DESTINATION"
rm deploy_key