forked from txrx90/EaglercraftX-Server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
selsrv.sh
51 lines (45 loc) · 1.48 KB
/
selsrv.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
exit
SRV=$(dialog --menu "Choose a server software:\n(or cancel for no change)\nUse arrow keys and enter to select:" 12 40 3 1 "Paper 1.8.8 (recommended)" 2 "nPaper 1.7 (faster)" 3 "Cuberite (fastest)" --output-fd 1)
clear
case $SRV in
1)
echo "Switching to Paper 1.8.8..."
rm /tmp/server.jar
cp misc/paper-1.8.8.jar /tmp/server.jar
rm server/plugins/Carbon.jar
rm server/plugins/Carbon-ProtocolLib.jar
;;
2)
echo "Switching to nPaper 1.7..."
rm /tmp/server.jar
cp misc/npaper-1.7.jar /tmp/server.jar
cp misc/Carbon.jar server/plugins/Carbon.jar
cp misc/Carbon-ProtocolLib.jar server/plugins/Carbon-ProtocolLib.jar
;;
3)
echo "Switching to Cuberite..."
if [ ! -d "cuberite" ]; then
mkdir cuberite
rm /tmp/Cuberite.tar.gz
wget -O /tmp/Cuberite.tar.gz https://download.cuberite.org/linux-x86_64/Cuberite.tar.gz
tar -xvf /tmp/Cuberite.tar.gz -C ./cuberite
echo "[Authentication]" > cuberite/settings.ini
echo "Authenticate=0" >> cuberite/settings.ini
echo "AllowBungeeCord=1" >> cuberite/settings.ini
echo "OnlyAllowBungeeCord=1" >> cuberite/settings.ini
echo "[WebAdmin]" > cuberite/webadmin.ini
echo "Enabled=0" >> cuberite/webadmin.ini
rm /tmp/Cuberite.tar.gz
fi
rm server/server.jar
;;
*)
echo "Not changing server software..."
exit
;;
esac
if [ -f "/tmp/server.jar" ]; then
rm server/server.jar
mv /tmp/server.jar server/server.jar
fi