forked from SpartanPlume/Tosurnament
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·39 lines (35 loc) · 1.04 KB
/
setup.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
echo "Installing necessary packages... (Your sudo password might be needed)"
sudo pacman -S jq --needed
echo "Installing necessary packages... DONE"
DB_NAME=$(jq -r '.DB_NAME' constants.json)
DB_USERNAME=$(jq -r '.DB_USERNAME' constants.json)
DB_PASSWORD=$(jq -r '.DB_PASSWORD' constants.json)
python_dependencies=(
mysqlclient
requests
httplib2
oauth2client
google-api-python-client
asyncio
pycrypto
cryptography
discord.py
Pygments
blessings
mysqldb_wrapper
dateparser
)
echo "Intalling necessary python dependencies..."
for dependency in "${python_dependencies[@]}"
do
sudo python3 -m pip install -U $dependency
done
echo "Intalling necessary python dependencies... DONE"
echo "Setting up mysql database... (Your mysql root user's password might be needed)"
sudo mysql <<EOF
CREATE USER IF NOT EXISTS '$DB_USERNAME' IDENTIFIED BY '$DB_PASSWORD';
CREATE DATABASE IF NOT EXISTS $DB_NAME;
GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USERNAME';
FLUSH PRIVILEGES;
EOF
echo "Setting up mysql database... DONE"