-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnodejs.sh
170 lines (169 loc) · 9.32 KB
/
nodejs.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/bin/bash
sleep 1
clear
echo "############################################################################"
echo "# NodeJS Installer #"
echo "# by Nico L. #"
echo "# https://github.com/ipexadev/scripts #"
echo "# Last Update: 27.06.2022 #"
echo "############################################################################"
sleep 3
clear
echo "############################################################################"
echo "# Checking for Root #"
echo "############################################################################"
if (( $EUID != 0 )); then
echo "############################################################################"
echo "# Please run as root #"
echo "############################################################################"
exit
fi
sleep 1
clear
echo "############################################################################"
echo "# Checked for Root #"
echo "############################################################################"
sleep 2
clear
echo "############################################################################"
echo "# Press Enter to continue #"
echo "############################################################################"
read continuepress
sleep 1
clear
echo "############################################################################"
echo "# Installer #"
echo "# by Nico L. #"
echo "# https://github.com/nilasystem/scripts #"
echo "############################################################################"
echo "# #"
echo "# 1 | NodeJS + NPM Installation #"
echo "# 2 | NodeJS + NPM + PM2 Installation #"
echo "# 3 | NodeJS + NPM + Screen #"
echo "# #"
echo "############################################################################"
read -p "Please enter a Number:" installnumber
# NodeJS Installation
if [ "$installnumber" = "1" ]; then
clear
sleep 1
echo "############################################################################"
echo "# Installing NodeJS #"
echo "############################################################################"
sleep 2
echo "############################################################################"
echo "# Server Update (apt update -y) #"
echo "############################################################################"
apt update -y
wait -n
echo "############################################################################"
echo "# Server Upgrade (apt upgrade -y) #"
echo "############################################################################"
apt upgrade -y
wait -n
echo "############################################################################"
echo "# Installing NodeJS #"
echo "# curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - #"
echo "############################################################################"
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
wait -n
echo "############################################################################"
echo "# NodeJS Installation (apt install nodejs -y) #"
echo "############################################################################"
apt install nodejs -y
wait -n
echo "############################################################################"
echo "# NPM Installation (apt install npm -y) #"
echo "############################################################################"
apt install npm -y
wait -n
echo "############################################################################"
echo "# Installed NodeJS + NPM #"
echo "############################################################################"
fi
# NodeJS + PM2 Installation
if [ "$installnumber" = "2" ]; then
clear
sleep 1
echo "############################################################################"
echo "# Installing NodeJS + PM2 #"
echo "############################################################################"
sleep 2
echo "############################################################################"
echo "# Server Update (apt update -y) #"
echo "############################################################################"
apt update -y
wait -n
echo "############################################################################"
echo "# Server Upgrade (apt upgrade -y) #"
echo "############################################################################"
apt upgrade -y
wait -n
echo "############################################################################"
echo "# Installing NodeJS #"
echo "# curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - #"
echo "############################################################################"
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
wait -n
echo "############################################################################"
echo "# NodeJS Installation (apt install nodejs -y) #"
echo "############################################################################"
apt install nodejs -y
wait -n
echo "############################################################################"
echo "# NPM Installation (apt install npm -y) #"
echo "############################################################################"
apt install npm -y
wait -n
echo "############################################################################"
echo "# PM2 Installation (npm install pm2@latest -g) #"
echo "############################################################################"
npm install pm2@latest -g
wait -n
echo "############################################################################"
echo "# Installed NodeJS + NPM + PM2 #"
echo "############################################################################"
fi
# NodeJS + Screen Installation
if [ "$installnumber" = "3" ]; then
clear
sleep 1
echo "############################################################################"
echo "# Installing NodeJS + Screen #"
echo "############################################################################"
sleep 2
echo "############################################################################"
echo "# Server Update (apt update -y) #"
echo "############################################################################"
apt update -y
wait -n
echo "############################################################################"
echo "# Server Upgrade (apt upgrade -y) #"
echo "############################################################################"
apt upgrade -y
wait -n
echo "############################################################################"
echo "# Installing NodeJS #"
echo "# curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - #"
echo "############################################################################"
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
wait -n
echo "############################################################################"
echo "# NodeJS Installation (apt install nodejs -y) #"
echo "############################################################################"
apt install nodejs -y
wait -n
echo "############################################################################"
echo "# NPM Installation (apt install npm -y) #"
echo "############################################################################"
apt install npm -y
wait -n
echo "############################################################################"
echo "# Screen Installation (apt install screen -y) #"
echo "############################################################################"
apt install screen -y
wait -n
echo "############################################################################"
echo "# Installed NodeJS + NPM + Screen #"
echo "############################################################################"
fi