app_test/.github/rsync.sh

22 lines
489 B
Bash
Raw Normal View History

2023-05-12 00:49:32 +02:00
#! /usr/bin/env bash
set -Eeuo pipefail
set -x
2023-05-12 00:58:00 +02:00
apt-get update -y && apt-get install -y rsync openssh-client keychain tee
2023-05-12 00:51:35 +02:00
2023-05-12 00:49:32 +02:00
# README.md /tmp/ files.l3d.ch files ./secret_ssh_key
printf "Add SSH Private Key"
mkdir ~/.ssh
chmod 700 ~/.ssh
2023-05-12 00:58:00 +02:00
cat $5 | sha256sum
2023-05-12 00:49:32 +02:00
mv $5 ~/.ssh/id_ed25519
chmod 400 ~/.ssh/id_ed25519
ssh-keyscan -t ed25519 $3 | tee -a ~/.ssh/known_hosts
2023-05-12 00:54:41 +02:00
printf "Adding SSH to chain"
eval $(keychain --eval --quiet id_ed25519)
printf "Starting rsync"
2023-05-12 00:49:32 +02:00
rsync --progress $1 $4@$3:$2