This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
82 lines (64 loc) · 1.58 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
#! /bin/bash
# Change arguments here
export MINECRAFTJAR=forge-1.16.5-36.2.35.jar
export RAM=12G
export JAVA=/home/sweetie/bin/jdk8u332-b09/bin/java
export LOCKFILE=minecraft.pid
if [ -f $LOCKFILE ]
then
echo 'it looks like minecraft is already running'
echo 'if you think that is wrong and theres a stale lockfile, here is the process:'
ps `cat $LOCKFILE`
echo '====='
echo "if there is no process, delete $LOCKFILE and run this script again"
exit
fi
# remove the lock file if control-c
trap "rm -f $LOCKFILE; exit" INT TERM EXIT
echo $$ > $LOCKFILE
while true;
do
ulimit -a
$JAVA -Xms$RAM -Xmx$RAM \
-Dmixin.debug.export=true \
-Dmixin.debug.verbose=true \
-XX:+UseLargePagesInMetaspace \
-XX:+UseG1GC \
-XX:+ParallelRefProcEnabled \
-XX:MaxGCPauseMillis=200 \
-XX:+UnlockExperimentalVMOptions \
-XX:+DisableExplicitGC \
-XX:+AlwaysPreTouch \
-XX:G1NewSizePercent=40 \
-XX:G1MaxNewSizePercent=50 \
-XX:G1HeapRegionSize=32M \
-XX:G1ReservePercent=15 \
-XX:G1HeapWastePercent=5 \
-XX:G1MixedGCCountTarget=4 \
-XX:InitiatingHeapOccupancyPercent=20 \
-XX:G1MixedGCLiveThresholdPercent=90 \
-XX:G1RSetUpdatingPauseTimePercent=5 \
-XX:SurvivorRatio=32 \
-XX:+PerfDisableSharedMem \
-XX:MaxTenuringThreshold=1 \
-jar $MINECRAFTJAR nogui
rm world/minecolonies/*.zip
~/bin/backup-minecraft-full.sh
cd mods/
ls -lh *.jar > mods.txt
cd ..
git add .
git commit -m "Sync from Server."
git push
echo restarting in 5 seconds...
sleep 1
echo restarting in 4 seconds...
sleep 1
echo restarting in 3 seconds...
sleep 1
echo restarting in 2 seconds...
sleep 1
echo restarting in 1 second...
sleep 1
done
rm -f $LOCKFILE