Skip to content

Instantly share code, notes, and snippets.

@arosales
Created May 31, 2018 15:29
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 arosales/e37c542c12e43af4457bf7ec579f0736 to your computer and use it in GitHub Desktop.
Save arosales/e37c542c12e43af4457bf7ec579f0736 to your computer and use it in GitHub Desktop.
Unattended Ubuntu 16.04 pkg update and install
#!/bin/bash
echo "updating and installing apache"
sudo apt update
sudo apt -y upgrade
sudo apt install -y apache2
sudo chown -R `whoami`:`id -gn` /var/www/html
sudo apt install -y git
echo "making proj"
mkdir ~/proj
cd ~/proj
git init --bare
cat > hooks/post-receive <<EOF
#!/bin/bash
git --work-tree=/var/www/html --git-dir=/home/demo/proj checkout -f
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment