Skip to content

Instantly share code, notes, and snippets.

@bytespider
Created March 13, 2015 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bytespider/ee75377b999d3b296f5d to your computer and use it in GitHub Desktop.
Save bytespider/ee75377b999d3b296f5d to your computer and use it in GitHub Desktop.
#!/bin/bash
PORT=2222
if [ ${VAGPORT} ]; then
PORT=${VAGPORT}
fi
IFS=$'\n'
SSH_CONFIG=($(vagrant ssh-config $1 | sed -e 's/^ *//' -e 's/ *$//'))
IFS=" "
SSH_CONFIG=(${SSH_CONFIG[@]// /=})
SSH_CONFIG_PARAM=$(printf -- "-o %s " "${SSH_CONFIG[@]}")
rsync -z -e "ssh ${SSH_CONFIG_PARAM}" --progress $1:$2 $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment