Created
March 13, 2015 15:59
-
-
Save bytespider/ee75377b999d3b296f5d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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