Created
July 22, 2014 07:39
-
-
Save coenjacobs/6f80533bef9f913b2c84 to your computer and use it in GitHub Desktop.
I use this script to run commands over SSH in a new Vagrant machine to setup my own dotfiles.
This file contains 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 | |
vagrant up | |
vagrant ssh << EOF | |
# If directory doesn't exist, clone the repository in ~/.dotfiles | |
if [ ! -d ~/.dotfiles ]; | |
then | |
git clone --recursive https://github.com/coenjacobs/dotfiles.git ~/.dotfiles | |
fi | |
# Check if zsh is already installed | |
if ! dpkg-query -l zsh | grep -q ^.i | |
then | |
sudo apt-get update && sudo apt-get -y install zsh | |
fi | |
# Check for line in .profile that makes zsh default shell | |
if ! grep -Fxq "[ -f /usr/bin/zsh ] && exec /usr/bin/zsh -l" ~/.profile | |
then | |
echo "[ -f /usr/bin/zsh ] && exec /usr/bin/zsh -l" >> ~/.profile | |
fi | |
# Run install file inside dotfiles repository | |
sh ~/.dotfiles/scripts/install.sh | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment