-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
91 lines (90 loc) · 2.97 KB
/
start.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
#!/bin/bash
# PteroPlug Start Script
#
#
#
#
#
#
#
#
#
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo " "
echo " "
echo " "
echo " "
echo " "
echo "THERE IS A NEWER VERSION OF THE PTEROPLUG EGG."
echo "Please go update, as the newer versions are much more optimized and will run much more reliably."
echo "https://github.com/ImLunaUwU/PteroPlug"
echo "Thank you! - Luna"
echo " "
echo " "
echo " "
echo " "
echo " "
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "Checking for change in server software."
if [ "$2" = "purpur" ]; then
if [ ! -f purpur.jar ]; then
echo -e "Downloading Purpur server..."
curl -o ${SERVER_TYPE}.jar https://api.purpurmc.org/v2/purpur/${GAME_VERSION}/latest/download
rm -f paper.jar spigot.jar fabric.jar
fi
elif [ "$2" = "paper" ]; then
if [ ! -f paper.jar ]; then
rm -f spigot.jar purpur.jar fabric.jar
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo " "
echo " "
echo " "
echo " "
echo " "
echo "Due to the nature of Pterodactyl start scripts and PaperMC's awful download API, Paper can not be \"hotswapped\"."
echo "Please manually download Paper from https://papermc.io/downloads and place it in the server directory."
echo "Please note, it is required to be named \"paper.jar\", otherwise the server cannot start."
echo " "
echo " "
echo " "
echo " "
echo " "
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit
fi
elif [ "$2" = "spigot" ]; then
if [ ! -f spigot.jar ]; then
echo -e "Downloading Spigot server..."
curl -o ${SERVER_TYPE}.jar https://download.getbukkit.org/spigot/spigot-${GAME_VERSION}.jar
rm -f paper.jar purpur.jar fabric.jar
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo " "
echo " "
echo " "
echo " "
echo " "
echo -e "It is recommended that you switch to Purpur. It has better performance and is updated more often."
echo " "
echo " "
echo " "
echo " "
echo " "
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
fi
elif [ "$2" = "fabric" ]; then
if [ ! -f fabric.jar ]; then
echo -e "Downloading Fabric server..."
wget -O ${SERVER_TYPE}.jar https://meta.fabricmc.net/v2/versions/loader/${GAME_VERSION}/${LOADER_VERSION}/${FABRIC_VERSION}/server/jar
rm -f paper.jar purpur.jar spigot.jar
fi
else
echo "No change in server software."
fi
if [ ! -f hasrun ]; then
echo "Waiting for congfigs to apply. Please wait 5 seconds."
sleep 5
echo 'The server has run more than once.' > hasrun
java -Xms128M -Xmx500M -Dterminal.jline=false -Dterminal.ansi=true -jar "$1"
else
java -Xms128M -Xmx500M -Dterminal.jline=false -Dterminal.ansi=true -jar "$1"
fi