diff --git a/copy.sh b/copy.sh index 68ad8be..33b92a5 100644 --- a/copy.sh +++ b/copy.sh @@ -16,6 +16,8 @@ create_key_from_env() { mkdir "$HOME"/.ssh fi + info "Creating key from input variable" + echo "${PLUGIN_SSH_PRIVATE_KEY}" >"$HOME"/.ssh/id_rsa chmod 600 "$HOME"/.ssh/id_rsa dropbearconvert openssh dropbear "$HOME"/.ssh/id_rsa "$HOME"/.ssh/id_dropbear @@ -54,6 +56,7 @@ scp -o StrictHostKeyChecking=accept-new \ "${PLUGIN_REMOTE_USER}"@"${PLUGIN_REMOTE_HOST}":"${PLUGIN_REMOTE_PATH}" >/dev/null 2>&1 scp_status=$? +info "Cleaning up SSH keys" rm -r "$HOME"/.ssh if [ "$scp_status" -ne 0 ]; then