-
Notifications
You must be signed in to change notification settings - Fork 0
/
startserver.sh
executable file
·54 lines (48 loc) · 1.63 KB
/
startserver.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
#!/bin/bash
source "$HOME/HeroiCraft/scripts/sourceme" || exit 4 # Exit if sourceme isn't found
clear
if [[ -z $1 ]]; then
echo No Server Provided
echo "Do ./${0##*/} <servername> to run"
exit 1
else
serverName=$1
fi
function restart {
echo "Do you want to Restart? [y/N]"
read restart
if [ "$restart" == y ]; then
startServer $serverName
else
exit
fi
}
function startServer {
if [ "$serverName" == bungee ]; then
xtitle "Minecraft Server: BungeeCord"
cd "$HeroiCraftDIR/$serverName/"
rm plugins/CommandSync/data.txt
echo "Starting $serverName"
java -jar "$bungeeType".jar -Xmx1G
echo
restart
else
xtitle "Minecraft Server: $serverName"
cd "$HeroiCraftDIR/$serverName/"
rm plugins/CommandSync/data.txt
rm plugins/CraftBukkitUpToDate/CraftBukkitUpToDate.sav
echo "Starting $serverName..."
echo
trap control_c SIGINT
java -server -Xmx"$mcRam"G \
-XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSIncrementalMode -XX:+CMSIncrementalPacing -XX:+CMSParallelRemarkEnabled -XX:MaxGCPauseMillis=50 -XX:+DisableExplicitGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseBiasedLocking -XX:TargetSurvivorRatio=90 -Djava.net.preferIPv4Stack=true \
-jar "$spigotType".jar --log-strip-color
echo
restart
fi
}
function control_c {
echo "CTRL-C pressed, be careful!"
}
startServer $serverName
# Old Args: # -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=50 -XX:+DisableExplicitGC -XX:G1HeapRegionSize=4M -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50 -XX:G1MaxNewSizePercent=80 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=50 -XX:+AggressiveOpts \