-
Notifications
You must be signed in to change notification settings - Fork 155
/
startserver
executable file
·61 lines (49 loc) · 2.04 KB
/
startserver
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
#!/bin/bash
export MAIN_DIR=$PWD
echo "> Starting the server up. Please wait..."
echo "> Installing Dependencise..."
sudo apt install -y -qq screen wget
echo "> Dependencise Installed!"
echo "> Checking Server Type..."
if [ -f $MAIN_DIR/server/bedrock_server ]; then
echo "> Bedrock Server Detected! Starting Server up..."
elif [ ! -f $MAIN_DIR/server/eula.txt ]; then
cd $MAIN_DIR/server
echo "> EULA doesn't exist! Creating one!"
echo "eula=true" > eula.txt
echo "> EULA Completed! Restarting Server"
cd $MAIN_DIR
screen -S server -d -m ./startJavaServer
clear
echo "> Your server just doing a second restart to fix the EULA file."
killall screen
./startserver
exit
elif [ -f $MAIN_DIR/server/eula.txt ]; then
echo "> EULA Detected! Starting Server up..."
else
echo "> Your server isn't setup properly. Force uninstall..."
cd $MAIN_DIR
./uninstall
echo "> Comfirmed Uninstallation! Restarting Installation..."
./install
fi
# apparently ppl keep spamming startserver and end up having multiple screens of the same app
killall screen
screen -S server -d -m ./startJavaServer # Starting Java Server
screen -S server -d -m ./startBedrockServer # Starting Bedrock Server
screen -S afk -d -m ./startAfk #Starting AFK app aka bpytop.
screen -S playit -d -m ./startPlayIt # Starting Playit
cd $MAIN_DIR/server
screen -S server -d -m ./bin/php7/bin/php ./PocketMine-MP.phar --no-wizard --disable-ansi # Starting PocketmineMP
screen -S server -d -m java --add-opens java.base/java.nio=io.netty.common --add-exports java.base/jdk.internal.misc=io.netty.common -p modules -m gomint.server/io.gomint.server.Bootstrap # Starting GoMint
cd $MAIN_DIR
echo "-- Your Server is now ONLINE! --"
echo
echo "Type [screen -ls] to check the Running Processes"
echo "Type [screen -r server] to enter the Server Console"
echo "Type [screen -r playit] to view your Server IP"
echo ""
echo "> To stop your server, type './stopserver' to stop"
echo -e '\nchecking if server has launched properly'
./.checkserver 2> crash.log