forked from W3LFARe/docker-allthemods10
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch.sh
47 lines (40 loc) · 1.36 KB
/
launch.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
#!/bin/bash
set -x
NEOFORGE_VERSION=21.1.81
cd /data
if ! [[ "$EULA" = "false" ]]; then
echo "eula=true" > eula.txt
else
echo "You must accept the EULA to install."
exit 99
fi
if ! [[ -f 'Server-Files-1.25.0.zip' ]]; then
rm -fr config defaultconfigs kubejs mods packmenu Simple.zip forge*
curl -Lo 'Server-Files-1.25.0.zip' 'https://edge.forgecdn.net/files/5940/563/Server-Files-1.25.zip' || exit 9
unzip -u -o 'Server-Files-1.25.0.zip' -d /data
DIR_TEST=$(find . -type d -maxdepth 1 | tail -1 | sed 's/^.\{2\}//g')
if [[ $(find . -type d -maxdepth 1 | wc -l) -gt 1 ]]; then
cd "${DIR_TEST}"
mv -f * /data
cd /data
rm -fr "$DIR_TEST"
fi
curl -Lo neoforge-${NEOFORGE_VERSION}-installer.jar http://files.neoforged.net/maven/net/neoforged/neoforge/$NEOFORGE_VERSION/neoforge-$NEOFORGE_VERSION-installer.jar
java -jar neoforge-${NEOFORGE_VERSION}-installer.jar --installServer
fi
if [[ -n "$JVM_OPTS" ]]; then
sed -i '/-Xm[s,x]/d' user_jvm_args.txt
for j in ${JVM_OPTS}; do sed -i '$a\'$j'' user_jvm_args.txt; done
fi
if [[ -n "$MOTD" ]]; then
sed -i "s/motd\s*=/ c motd=$MOTD" /data/server.properties
fi
if [[ -n "$OPS" ]]; then
echo $OPS | awk -v RS=, '{print}' > ops.txt
fi
if [[ -n "$ALLOWLIST" ]]; then
echo $ALLOWLIST | awk -v RS=, '{print}' > white-list.txt
fi
sed -i 's/server-port.*/server-port=25565/g' server.properties
chmod 755 run.sh
./run.sh