easyctf-2017/scripts/setup.sh

32 lines
926 B
Bash
Raw Normal View History

2015-12-21 01:04:00 -06:00
#!/bin/bash
2015-12-23 00:26:27 -06:00
MYSQL_ROOT_PASSWORD="i_hate_passwords"
2015-12-21 01:04:00 -06:00
echo "Updating system..."
2015-12-23 00:26:27 -06:00
apt-get -y update
apt-get -y upgrade
echo "Preparing for MySQL installation..."
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASSWORD"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD"
2015-12-21 01:04:00 -06:00
echo "Installing dependencies..."
2015-12-23 00:26:27 -06:00
apt-get -y install python
apt-get -y install python-pip
apt-get -y install python-dev libmysqlclient-dev
apt-get -y install nginx
apt-get -y install mysql-server
2016-01-02 21:20:50 -05:00
apt-get -y install tmux
2015-12-21 01:04:00 -06:00
echo "Installing pip dependencies..."
2016-01-02 21:16:47 -05:00
pip install -r /vagrant/scripts/requirements.txt
2015-12-23 00:26:27 -06:00
echo "PATH=$PATH:/vagrant" >> /etc/profile
2016-01-02 21:20:50 -05:00
source /etc/profile
2015-12-23 00:26:27 -06:00
cp /vagrant/ctf.nginx /etc/nginx/sites-enabled/ctf
2015-12-23 00:40:32 -06:00
rm /etc/nginx/sites-*/default
2015-12-21 17:37:08 -05:00
2016-01-02 21:16:47 -05:00
sudo service nginx restart
mysql -u root -p"$MYSQL_ROOT_PASSWORD" -e "CREATE DATABASE easyctf;"