-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlq_install.sh
More file actions
executable file
·82 lines (60 loc) · 2.13 KB
/
lq_install.sh
File metadata and controls
executable file
·82 lines (60 loc) · 2.13 KB
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
78
79
80
81
#!/bin/bash -e
# Disclaimer and stuff
###############################################################################
set -e
###############################################################################
# Configuration
###############################################################################
# which user should run the LQFB code
LQFB_USER=lqfb
# the group to run LQFB code as
LQFB_GROUP=nogroup
# the root directory in which to install the LQFB code
LQFB_HOME=/home/$LQFB_USER
LQFB_OWNER=lqfb
# the domain that you will connect to your LQFB install with.
# MUST contain a . in it somewhere as browsers won't do cookies for dotless
# domains. an IP address will suffice if nothing else is available.
LQFB_DOMAIN=${LQFB_DOMAIN:-LQFB.local}
###############################################################################
# Sanity Checks
###############################################################################
if [[ $EUID -ne 0 ]]; then
echo "ERROR: Must be run with root privileges."
exit 1
fi
# Here was a check if the correct version of dubuntu/debian is running
###############################################################################
# Install prerequisites
###############################################################################
set -x
# create the user if non-existent
if ! id $LQFB_USER &> /dev/null; then
adduser --system $LQFB_USER
fi
# aptitude configuration
APTITUDE_OPTIONS="-y" # limit bandwidth: -o Acquire::http::Dl-Limit=100"
export DEBIAN_FRONTEND=noninteractive
# run an aptitude update to make sure python-software-properties
# dependencies are found
aptitude update
aptitude upgrade
# install prerequisites
cat <<PACKAGES | xargs apt-get install $APTITUDE_OPTIONS
git-core
lua5.1
postgresql
build-essential
libpq-dev
liblua5.1-0-dev
lighttpd
ghc
libghc6-parsec3-dev
imagemagick
exim4
PACKAGES
# create lqfb psql user
echo "CREATE ROLE lqfb WITH CREATEDB PASSWORD '123';" | su postgres -c "psql"
# get LQFB data --- repüto github repo
git clone https://github.com/PPOE/liquid_ppat_core.git $LQFB_HOME/core
git clone https://github.com/PPOE/liquid_ppat_frontend.git $LQFB_HOME/frontend