-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall.sh
More file actions
261 lines (192 loc) · 10.2 KB
/
install.sh
File metadata and controls
261 lines (192 loc) · 10.2 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
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
#!/bin/bash
trap 'ret=$?; test $ret -ne 0 && printf "failed\n\n" > &2; exit $ret' EXIT
set -e
log_info() {
printf "\n\e[0;35m $1\e[0m\n\n"
}
RAM=`echo $(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE) / (1024 * 1024)))`
NGINX=`nginx --version`
MYSQL=`mysql --version`
NODE=`node --version`
PYTHON=`python --version`
PYTHON3=`python3 --version`
PHP=`php --version`
REDIS=`redis-server --version`
VARNISH=`varnish --version`
log_info "Checking your system ..."
if [[ $RAM < = 1999 ]]; then
echo "You have $RAM of Memory/RAM available"
echo "For the installation, you need at least 2GB Memory - https://www.cloudpanel.io/docs/v2/requirements/#memory"
exit
fi
if [[ $NGINX ]]; then
echo "You have $NGINX installed"
echo "For the installation, you need an empty server with Ubuntu 24.04, 22.04 or Debian 12, 11 with root access - https://www.cloudpanel.io/docs/v2/technology-stack/"
exit
fi
if [[ $MYSQL ]]; then
echo "You have $MYSQL installed"
echo "For the installation, you need an empty server with Ubuntu 24.04, 22.04 or Debian 12, 11 with root access - https://www.cloudpanel.io/docs/v2/technology-stack/"
exit
fi
if [[ $NODE ]]; then
echo "You have $NODE installed"
echo "For the installation, you need an empty server with Ubuntu 24.04, 22.04 or Debian 12, 11 with root access - https://www.cloudpanel.io/docs/v2/technology-stack/"
exit
fi
if [[ $PYTHON ]]; then
echo "You have $PYTHON installed"
echo "For the installation, you need an empty server with Ubuntu 24.04, 22.04 or Debian 12, 11 with root access - https://www.cloudpanel.io/docs/v2/technology-stack/"
exit
fi
if [[ $PYTHON3 ]]; then
echo "You have $PYTHON3 installed"
echo "For the installation, you need an empty server with Ubuntu 24.04, 22.04 or Debian 12, 11 with root access - https://www.cloudpanel.io/docs/v2/technology-stack/"
exit
fi
if [[ $PHP ]]; then
echo "You have $PHP installed"
echo "For the installation, you need an empty server with Ubuntu 24.04, 22.04 or Debian 12, 11 with root access - https://www.cloudpanel.io/docs/v2/technology-stack/"
exit
fi
if [[ $REDIS ]]; then
echo "You have $REDIS installed"
echo "For the installation, you need an empty server with Ubuntu 24.04, 22.04 or Debian 12, 11 with root access - https://www.cloudpanel.io/docs/v2/technology-stack/"
exit
fi
if [[ $VARNISH ]]; then
echo "You have $VARNISH installed"
echo "For the installation, you need an empty server with Ubuntu 22.04 or Debian 11 with root access - https://www.cloudpanel.io/docs/v2/technology-stack/"
exit
fi
log_info "Set Timezone for your server ..."
sudo dpkg-reconfigure tzdata
log_info "Install CloudPanel ..."
sudo apt update && apt -y install curl wget sudo
IP=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`
DISTRO=`cat /etc/*-release | grep "^ID=" | grep -E -o "[a-z]\w+"`
VERSION=`lsb_release --release | cut -f2 | cut -c 1`
echo "Your operating system is $DISTRO"
if [ "$DISTRO" = "debian" ]; then
if [ "$VERSION" = "12" ]; then
echo "What version of database engine you want to use? (options: 8.4, 8.0, 5.7, 11.4, 10.11) "
read MYSQL_VERSION
echo "Installing preferred Database Engine ... "
if [ "$MYSQL_VERSION" = "8.4" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MYSQL_8.4 bash install.sh
elif [ "$MYSQL_VERSION" = "8.0" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MYSQL_8.0 bash install.sh
elif [ "$MYSQL_VERSION" = "10.11" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MARIADB_10.11 bash install.sh
else
echo "$MYSQL_VERSION"
echo "Sorry there is nothing for MySQL/MariaDB v$MYSQL_VERSION"
exit
fi
echo "==========================================================="
echo "You can now access CloudPanel via Browser: http://$IP:8443"
elif [ "$VERSION" = "11" ]; then
echo "What version of database engine you want to use? (options: 8.4, 8.0, 5.7, 11.4, 10.11, 10.9, 10.8, 10.7) "
read MYSQL_VERSION
echo "Installing preferred Database Engine ... "
if [ "$MYSQL_VERSION" = "8.4" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MYSQL_8.4 bash install.sh
elif [ "$MYSQL_VERSION" = "8.0" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MYSQL_8.0 bash install.sh
elif [ "$MYSQL_VERSION" = "11.4" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MARIADB_11.4 bash install.sh
elif [ "$MYSQL_VERSION" = "10.11" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MARIADB_10.11 bash install.sh
else
echo "$MYSQL_VERSION"
echo "Sorry there is nothing for MySQL/MariaDB v$MYSQL_VERSION"
exit
fi
echo "==========================================================="
echo "You can now access CloudPanel via Browser: http://$IP:8443"
else
echo "Sorry $DISTRO v$VERSION is not supported."
exit
fi
elif [ "$DISTRO" = "ubuntu" ]; then
if [ "$VERSION" = "24" ]; then
echo "What version of database engine you want to use? (options: 8.4, 8.0, 11.4, 10.11) "
read MYSQL_VERSION
echo "Installing preferred Database Engine ... "
if [ "$MYSQL_VERSION" = "8.4" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MYSQL_8.4 bash install.sh
elif [ "$MYSQL_VERSION" = "8.0" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MYSQL_8.0 bash install.sh
elif [ "$MYSQL_VERSION" = "11.4" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MARIADB_11.4 bash install.sh
elif [ "$MYSQL_VERSION" = "10.11" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MARIADB_10.11 bash install.sh
else
echo "$MYSQL_VERSION"
echo "Sorry there is nothing for MySQL/MariaDB v$MYSQL_VERSION"
exit
fi
echo "==========================================================="
echo "You can now access CloudPanel via Browser: http://$IP:8443"
elif [ "$VERSION" = "22" ]; then
echo "What version of database engine you want to use? (options: 8.0, 10.11, 10.9, 10.8, 10.6) "
read MYSQL_VERSION
echo "Installing preferred Database Engine ... "
if [ "$MYSQL_VERSION" = "8.0" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo bash install.sh
elif [ "$MYSQL_VERSION" = "10.11" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MARIADB_10.11 bash install.sh
elif [ "$MYSQL_VERSION" = "10.9" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "d67e37c0fb0f3dd7f642f2c21e621e1532cadefb428bb0e3af56467d9690b713 install.sh" | \
sha256sum -c && sudo DB_ENGINE=MARIADB_10.9 bash install.sh
elif [ "$MYSQL_VERSION" = "10.8" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "d67e37c0fb0f3dd7f642f2c21e621e1532cadefb428bb0e3af56467d9690b713 install.sh" | \
sha256sum -c && sudo DB_ENGINE=MARIADB_10.8 bash install.sh
elif [ "$MYSQL_VERSION" = "10.6" ]; then
curl -sS https://installer.cloudpanel.io/ce/v2/install.sh -o install.sh; \
echo "19cfa702e7936a79e47812ff57d9859175ea902c62a68b2c15ccd1ebaf36caeb install.sh" | \
sha256sum -c && sudo DB_ENGINE=MARIADB_10.6 bash install.sh
else
echo "$MYSQL_VERSION"
echo "Sorry there is nothing for MySQL/MariaDB v$MYSQL_VERSION"
exit
fi
echo "==========================================================="
echo "You can now access CloudPanel via Browser: http://$IP:8443"
else
echo "Sorry $DISTRO v$VERSION is not supported."
exit
fi
else
echo "$DISTRO v$VERSION"
echo "Sorry this is not for you - https://www.cloudpanel.io/docs/v2/requirements/"
exit
fi