forked from dabook-studio/nebula-setup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprerequisites.sh
executable file
·78 lines (59 loc) · 1.45 KB
/
prerequisites.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
function install_db_server {
echo "Installing DB server"
apt -y install postgresql
}
function install_memcached {
echo "Installing memcached server"
apt -y install memcached
}
function install_node {
echo "Installing node server requirements"
apt install -y libmemcached-dev python3-pip cifs-utils zlib1g-dev python3-dev build-essential
pip3 install pylibmc psutil psycopg2-binary pyyaml requests
}
function install_core {
echo "Installing core server requirements"
pip3 install cherrypy jinja2 htmlmin
}
do_install_db=0
do_install_mc=0
do_install_node=0
do_install_core=0
read -p "Install DB server? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
do_install_db=1
fi
read -p "Install memcached server? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
do_install_mc=1
fi
read -p "Install node? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
do_install_node=1
read -p "Install core server requirements? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
do_install_core=1
fi
fi
echo ""
if [ $do_install_db == 1 ]; then
install_db_server || exit 1
fi
if [ $do_install_mc == 1 ]; then
install_memcached || exit 1
fi
if [ $do_install_node == 1 ]; then
install_node || exit 1
fi
if [ $do_install_core == 1 ]; then
install_core || exit 1
fi