Skip to content

Instantly share code, notes, and snippets.

@bytespider
Created March 13, 2015 16:00
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/909f1a40b5e0f5cf90fd to your computer and use it in GitHub Desktop.
Save bytespider/909f1a40b5e0f5cf90fd 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[@]}")
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