Skip to content

Instantly share code, notes, and snippets.

@BRMatt
Created July 13, 2012 17:21
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 BRMatt/3106102 to your computer and use it in GitHub Desktop.
Save BRMatt/3106102 to your computer and use it in GitHub Desktop.
A faster vagrant console
#/bin/bash
# Make sure we're in the same folder as the vagrant file
SOURCE="${BASH_SOURCE[0]}"
DIR="$( dirname "$SOURCE" )"
while [ -h "$SOURCE" ]
do
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
cd $DIR
ssh vagrant@localhost -p2222 -i ~/.vagrant.d/insecure_private_key "cd /project-dir/ && ${*:1}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment