Add SSH port variable

This commit is contained in:
2023-12-21 11:53:43 +01:00
parent 05e907702c
commit 24018208b1
3 changed files with 9 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
set -euo pipefail
options="$1"
ssh_port="$2"
SSH_HOME="${HOME}/.ssh"
SSH_KEYPATH="${SSH_HOME}/deploy_key"
@@ -12,5 +13,5 @@ chmod 600 "$SSH_KEYPATH"
echo "Deploying..."
rsync $options \
-e "ssh -i $SSH_KEYPATH -o StrictHostKeyChecking=no" \
-e "ssh -p $ssh_port -i $SSH_KEYPATH -o StrictHostKeyChecking=no" \
"$RSYNC_SOURCE" "$RSYNC_USERHOST":"$RSYNC_DESTINATION"