-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
51 lines (32 loc) · 1.21 KB
/
install.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
#!/bin/bash
if [[ "$USER" != "root" ]]; then
exit;
fi
CWD=$PWD
export DEBIAN_FRONTEND=noninteractive
[ -d /opt ] || mkdir -p /opt
cd /opt
apt-get update
apt-get -q -y install ntp
apt-get -q -y install mongodb
apt-get -q -y install nodejs-legacy npm git r-base-core libopenblas-base
apt-get -q -y install iptables-persistent
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 3443
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3080
iptables-save > /etc/iptables/rules.v4
ip6tables-save > /etc/iptables/rules.v6
git clone https://github.com/nabudaldah/documents.git
cd /opt/documents
npm install bower -g
npm install forever -g
Rscript -e "install.packages(c('data.table', 'readxl', 'magrittr', 'dplyr', 'tidyr', 'rmongodb', 'xts', 'uuid', 'ggplot2', 'stringr'), repos='http://cran-mirror.cs.uu.nl/')"
cp /opt/documents/documents.service /etc/init/documents.service
cp /opt/documents/config.template /opt/documents/config.json
cd /opt/documents
npm install
cd /opt/documents/pub
bower install -s --allow-root --no-interactive | xargs echo
[ -d /opt/documents/pub/tmp ] || mkdir -p /opt/documents/pub/tmp
systemctl daemon-reload
systemctl start documents
cd $CWD