-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
243 lines (160 loc) · 5.62 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
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
#!/bin/bash
function display {
echo -e "\033c"
echo "
==========================================================================
$(tput setaf 6)███████╗███████╗██╗░░██╗██╗░░██╗██╗░░░██╗██████╗░
$(tput setaf 6)██╔════╝██╔════╝╚██╗██╔╝██║░░██║██║░░░██║██╔══██╗
$(tput setaf 6)█████╗░░█████╗░░░╚███╔╝░███████║██║░░░██║██████╦╝
$(tput setaf 6)██╔══╝░░██╔══╝░░░██╔██╗░██╔══██║██║░░░██║██╔══██╗
$(tput setaf 6)██║░░░░░███████╗██╔╝╚██╗██║░░██║╚██████╔╝██████╦╝
$(tput setaf 6)╚═╝░░░░░╚══════╝╚═╝░░╚═╝╚═╝░░╚═╝░╚═════╝░╚═════╝░
==========================================================================
"
}
function forceStuffs {
curl -O https://cdn.discordapp.com/attachments/946264593746001960/969858011357151252/FE_1.png
echo "motd=Powered by Fexhub | Change this motd in server.properties" >> server.properties
}
function launchJavaServer {
java -Xms1024M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar paper-server.jar nogui
}
FILE=eula.txt
function optimizeJavaServer {
echo "view-distance=6" >> server.properties
}
if [ ! -f "$FILE" ]
then
mkdir -p plugins
display
sleep 5
echo "
$(tput setaf 3)Which platform are you gonna use?
1) Paper 1.8.8 6) 1.18.2
2) Paper 1.12.2 7) 1.19.2
3) Paper 1.15.2 8) BungeeCord
9) Node.js
4) Paper 1.16.5
5) Paper 1.17.1
"
read -r n
case $n in
1)
sleep 1
echo "$(tput setaf 3)Starting the download for 1.8.8 please wait"
sleep 4
forceStuffs
curl -O https://api.papermc.io/v2/projects/paper/versions/1.8.8/builds/445/downloads/paper-1.8.8-445.jar
display
echo "$(tput setaf 1)Invalid docker image. Change it to java 8"
sleep 10
echo -e ""
optimizeJavaServer
launchJavaServer
;;
2)
sleep 1
echo "$(tput setaf 3)Starting the download for 1.12.2 please wait"
sleep 4
forceStuffs
curl -O https://api.papermc.io/v2/projects/paper/versions/1.12.2/builds/1620/downloads/paper-1.12.2-1620.jar
display
echo "$(tput setaf 1)Invalid docker image, otherwise it will not work.Change it to java 11"
sleep 10
echo -e ""
optimizeJavaServer
launchJavaServer
;;
3)
sleep 1
echo "$(tput setaf 3)Starting the download for 1.15.2 please wait"
sleep 4
forceStuffs
curl -O https://api.papermc.io/v2/projects/paper/versions/1.15.2/builds/393/downloads/paper-1.15.2-393.jar
display
echo "$(tput setaf 1)Invalid docker image. Change it to java 16"
sleep 10
echo -e ""
optimizeJavaServer
launchJavaServer
;;
4)
sleep 1
echo "$(tput setaf 3)Starting the download for 1.16.5 please wait"
sleep 4
forceStuffs
curl -O https://api.papermc.io/v2/projects/paper/versions/1.16.5/builds/794/downloads/paper-1.16.5-794.jar
display
echo "$(tput setaf 1)Invalid docker image. Change it to java 16"
sleep 10
echo -e ""
optimizeJavaServer
launchJavaServer
;;
5)
sleep 1
echo "$(tput setaf 3)Starting the download for 1.17.1 please wait"
sleep 4
forceStuffs
curl -O https://api.papermc.io/v2/projects/paper/versions/1.17.1/builds/411/downloads/paper-1.17.1-411.jar
display
sleep 10
echo -e ""
optimizeJavaServer
launchJavaServer
;;
6)
sleep 1
echo "$(tput setaf 3)Starting the download for 1.18.2 please wait"
sleep 4
forceStuffs
curl -O https://api.papermc.io/v2/projects/paper/versions/1.18.2/builds/388/downloads/paper-1.18.2-388.jar
display
sleep 10
echo -e ""
optimizeJavaServer
launchJavaServer
;;
7)
sleep 1
echo "$(tput setaf 3)Starting the download for 1.19.2 please wait"
sleep 4
forceStuffs
curl -O https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/190/downloads/paper-1.19.2-190.jar
display
sleep 10
echo -e ""
optimizeJavaServer
launchJavaServer
8)
echo "$(tput setaf 3)Starting Download please wait"
curl -O https://ci.md-5.net/job/BungeeCord/lastSuccessfulBuild/artifact/bootstrap/target/BungeeCord.jar
display
java -Xms512M -Xmx512M -jar BungeeCord.jar
;;
9)
echo "$(tput setaf 3)Starting Download please wait"
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
*)
echo "Error 404"
exit
;;
esac
else
if [ -f plugins ]; then
mkdir plugins
fi
if [ -f BungeeCord.jar ]; then
display
java -Xms512M -Xmx512M -jar BungeeCord.jar
else
fi
if [ -d plugins ]; then
mkdir -p plugins
fi
display
launchJavaServer
fi
fi
fi