Skip to content

Instantly share code, notes, and snippets.

@lilith
Created June 1, 2012 00:08
Show Gist options
  • Save lilith/2847400 to your computer and use it in GitHub Desktop.
Save lilith/2847400 to your computer and use it in GitHub Desktop.
Boot script for EC2 instances
#!/bin/sh
sudo yum update -y
cd /var/www/html/
#Update git repo and checkout the appropriate branch
if [ -r /var/www/html/.git/HEAD ]; then
su -s /bin/sh apache -c "git remote rm origin"
su -s /bin/sh apache -c "git remote add origin git@github.com:lensnetllc/direct-lens.git"
su -s /bin/sh apache -c "git pull origin master"
su -s /bin/sh apache -c "git checkout master"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment