Created
March 13, 2015 16:00
-
-
Save bytespider/909f1a40b5e0f5cf90fd 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[@]}") | |
scp ${SSH_CONFIG_PARAM} $1:$2 $2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment