-
Notifications
You must be signed in to change notification settings - Fork 7
/
install.sh
80 lines (64 loc) · 2.92 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
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
#!/bin/bash
clear
echo "-------------------------------------------------------------------------"
echo "Instalando componentes necessários do Sistema Operacional"
echo "-------------------------------------------------------------------------"
apt-get update
hash sudo 2>/dev/null || { apt-get -y install sudo; }
hash at 2>/dev/null || { apt-get -y install at; }
hash make 2>/dev/null || { apt-get -y install make; }
sudo apt-get -y install git-core build-essential openssl libssl-dev pkg-config
echo "OK"
echo "-------------------------------------------------------------------------"
echo "Atualizando Data/Hora"
echo "-------------------------------------------------------------------------"
date
echo "America/Sao_Paulo" | sudo tee /etc/timezone
sudo dpkg-reconfigure --frontend noninteractive tzdata
hash ntpdate 2>/dev/null || { apt-get -y install ntpdate; }
ntpdate pool.ntp.br
date
echo "OK"
echo "-------------------------------------------------------------------------"
echo "Instalando Node.js"
echo "-------------------------------------------------------------------------"
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.24.0/install.sh | bash
nvm install 0.10
echo "OK"
echo "-------------------------------------------------------------------------"
echo "Preparando diretório"
echo "-------------------------------------------------------------------------"
rm -r /var/www/isptools
rm -r /opt/tklweb-cp
mkdir -p /var/www/isptools
cd /var/www/isptools
echo "OK"
echo "-------------------------------------------------------------------------"
echo "Baixando ISPTools"
echo "-------------------------------------------------------------------------"
git init
git remote rm origin
#git remote add origin https://[email protected]/giovaneh/isptools.git
git remote add origin https://github.com/giovaneh/isptools.git
git pull origin master
hash pm2 2>/dev/null || { npm i -g pm2 --unsafe-perm; }
npm install --unsafe-perm
echo "OK"
echo "-------------------------------------------------------------------------"
echo "Iniciando ISP Tools"
echo "-------------------------------------------------------------------------"
pm2 kill
pm2 start app.js -x -f -i 1 --name ISPTools
pm2 -f startup ubuntu
echo "OK"
echo "-------------------------------------------------------------------------"
echo "FIM - www.isptools.com.br"
echo "-------------------------------------------------------------------------"
echo "Acesse o endereço abaixo para concluir o processo:"
echo ""
echo "http://www.isptools.com.br/cadastro"
echo ""
echo "Obrigado!"
echo "Giovane Heleno"
echo "-------------------------------------------------------------------------"
## wget -qO- https://bitbucket.org/giovaneh/isptools/raw/master/install.sh | sh