Added vagrant/puppet config (created with https://puphpet.com)
[memberdb.git] / shell / initial-setup.sh
1 #!/bin/bash
2
3 OS=$(/bin/bash /vagrant/shell/os-detect.sh ID)
4 CODENAME=$(/bin/bash /vagrant/shell/os-detect.sh CODENAME)
5
6 if [[ ! -d /.puphpet-stuff ]]; then
7     cat /vagrant/shell/self-promotion.txt
8     mkdir /.puphpet-stuff
9     echo "Created directory /.puphpet-stuff"
10 fi
11
12 if [[ ! -f /.puphpet-stuff/initial-setup-repo-update ]]; then
13     if [ "$OS" == 'debian' ] || [ "$OS" == 'ubuntu' ]; then
14         echo "Running initial-setup apt-get update"
15         apt-get update >/dev/null
16         touch /.puphpet-stuff/initial-setup-repo-update
17         echo "Finished running initial-setup apt-get update"
18     elif [[ "$OS" == 'centos' ]]; then
19         echo "Running initial-setup yum update"
20         yum update -y >/dev/null
21         echo "Finished running initial-setup yum update"
22
23         echo "Installing basic development tools (CentOS)"
24         yum -y groupinstall "Development Tools" >/dev/null
25         echo "Finished installing basic development tools (CentOS)"
26         touch /.puphpet-stuff/initial-setup-repo-update
27     fi
28 fi
29
30 if [[ "$OS" == 'ubuntu' && ("$CODENAME" == 'lucid' || "$CODENAME" == 'precise') && ! -f /.puphpet-stuff/ubuntu-required-libraries ]]; then
31     echo 'Installing basic curl packages (Ubuntu only)'
32     apt-get install -y libcurl3 libcurl4-gnutls-dev >/dev/null
33     echo 'Finished installing basic curl packages (Ubuntu only)'
34
35     touch /.puphpet-stuff/ubuntu-required-libraries
36 fi