-
Notifications
You must be signed in to change notification settings - Fork 2
/
init.sh
executable file
·56 lines (45 loc) · 1.42 KB
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get install -y python3
sudo apt-get install -y python-pip
sudo apt-get install -y zip
sudo apt-get install -y unzip
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirement.txt
PATH_NAME=$(pwd)
cd /tmp
PATH_NAME2=$(pwd)
echo "moved to ${PATH_NAME2}"
sudo wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt install --fix-broken -y
sudo dpkg -i google-chrome-stable_current_amd64.deb
cd ${PATH_NAME}
echo "moved to ${PATH_NAME}"
while :
do
echo "Please enter the password"
read p
unzip -P ${p} env.zip
if [ $? -eq 0 ]; then
echo "You entered correct password!"
break
else
echo "You entered incorrect password!"
fi
done
echo "Done."
google-chrome --version
echo "Make sure the current version is 102. If not, please manually download later version of chromedriver."
echo "running flask server..."
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql.service
sudo -u postgres createuser --interactive
sudo -u postgres createdb team6
sudo adduser team6
su - team6 -c 'psql -d "team6" -c "CREATE table history ( id INT, ts varchar(16), topic VARCHAR(30), pos_prob NUMERIC(4,3),
neg_prob NUMERIC(4,3),neu_prob NUMERIC(4,3))"'
su - team6 -c 'psql -d "team6" -c "CREATE table keywords ( id INT,word VARCHAR(30))"'
flask run --port=8888