Skip to content

Instantly share code, notes, and snippets.

@parente
Last active December 20, 2015 01:29
Show Gist options
  • Select an option

  • Save parente/6049886 to your computer and use it in GitHub Desktop.

Select an option

Save parente/6049886 to your computer and use it in GitHub Desktop.
TotT provisioner script for tottbox_2013_12_31. (With fix for issue #8.)
#!/bin/sh
# stash in a new loc
mv /vagrant/.ssh /vagrant/.keys > /dev/null 2>&1
# copy keys into the VM
cp /vagrant/.keys/github ~vagrant/.ssh/ > /dev/null 2>&1
chown vagrant:vagrant ~vagrant/.ssh/github
chmod 600 ~vagrant/.ssh/github
cp /vagrant/.keys/bitbucket ~vagrant/.ssh/ > /dev/null 2>&1
chown vagrant:vagrant ~vagrant/.ssh/bitbucket
chmod 600 ~vagrant/.ssh/bitbucket
# point to keys
( cat <<'EOP'
Host bitbucket.org
IdentityFile ~vagrant/.ssh/bitbucket
Host github.com
IdentityFile ~vagrant/.ssh/github
EOP
) > ~vagrant/.ssh/config
# add keys from home dir
( cat <<'EOP'
ssh-add -l | grep "github" > /dev/null
if [ $? != 0 ]; then
/usr/bin/ssh-add ~vagrant/.ssh/github > /dev/null 2>&1
fi
ssh-add -l | grep "bitbucket" > /dev/null
if [ $? != 0 ]; then
/usr/bin/ssh-add ~vagrant/.ssh/bitbucket > /dev/null 2>&1
fi
EOP
) >> ~vagrant/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment