This commit is contained in:
2023-03-23 07:27:33 -07:00
parent 3ee809797a
commit e468b81617
3 changed files with 21 additions and 27 deletions

View File

@@ -10,7 +10,7 @@ ARG INSTALL_SCRIPT=https://raw.githubusercontent.com/fithwum/minecraft/master/fo
# Install java-17 & Dependencies. # Install java-17 & Dependencies.
RUN apt-get -y update \ RUN apt-get -y update \
&& apt-get -y --fix-broken install \ && apt-get -y --fix-broken install \
&& apt-get install -y software-properties-common openjdk-17-jdk xvfb x11vnc \ && apt-get install -y software-properties-common unzip openjdk-17-jdk \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& update-ca-certificates -f; && update-ca-certificates -f;

View File

@@ -13,7 +13,7 @@ FORGE_VERSION_OLD=
MC_VERSION=1.19.3 MC_VERSION=1.19.3
FORGE_VERSION=44.1.0 FORGE_VERSION=44.1.0
MC_SERVER_FILE=https://maven.minecraftforge.net/net/minecraftforge/forge/${MC_VERSION}-${FORGE_VERSION}/forge-${MC_VERSION}-${FORGE_VERSION}-installer.jar MC_SERVER_FILE=https://nextcloud.fithwum.tech/s/Ay2DFBiNzRAxzjS/download/forge-${MC_VERSION}-${FORGE_VERSION}.zip
MC_RUN_FILE=https://raw.githubusercontent.com/fithwum/minecraft/master/forge/forge-${MC_VERSION}/files/run.sh MC_RUN_FILE=https://raw.githubusercontent.com/fithwum/minecraft/master/forge/forge-${MC_VERSION}/files/run.sh
EULA_FILE=https://raw.githubusercontent.com/fithwum/minecraft/master/forge/forge-${MC_VERSION}/files/eula.txt EULA_FILE=https://raw.githubusercontent.com/fithwum/minecraft/master/forge/forge-${MC_VERSION}/files/eula.txt
@@ -23,20 +23,19 @@ SERVER_PROPERTIES=https://raw.githubusercontent.com/fithwum/minecraft/master/for
# Main install (Debian). # Main install (Debian).
# Check for files in /MCserver and download if needed. # Check for files in /MCserver and download if needed.
if [ -e /MCserver/server_forge-${MC_VERSION}.jar ] if [ -e /MCserver/forge-${MC_VERSION}-${FORGE_VERSION}.zip ]
then then
echo " " echo " "
echo "INFO ! server_forge-${MC_VERSION}.jar found starting now." echo "INFO ! forge-${MC_VERSION}-${FORGE_VERSION}.zip found starting now."
else else
echo " " echo " "
echo "WARNING ! server_forge-${MC_VERSION}.jar is out of date/missing ... will download now." echo "WARNING ! forge-${MC_VERSION}-${FORGE_VERSION}.zip is out of date/missing ... will download now."
echo " " echo " "
echo "INFO ! Cleaning old files." echo "INFO ! Cleaning old files."
mkdir /MCserver/old-server-versions/${MC_VERSION_OLD}-${FORGE_VERSION_OLD} mkdir /MCserver/old-server-versions/${MC_VERSION_OLD}-${FORGE_VERSION_OLD}
mv /MCserver/server_forge-${MC_VERSION_OLD}-${FORGE_VERSION}.jar /MCserver/old-server-versions/${MC_VERSION_OLD}-${FORGE_VERSION_OLD} mv /MCserver/forge-${MC_VERSION_OLD}-${FORGE_VERSION}.zip /MCserver/old-server-versions/${MC_VERSION_OLD}-${FORGE_VERSION_OLD}
wget --no-cache ${MC_SERVER_FILE} -O /MCserver/server_forge-${MC_VERSION}-${FORGE_VERSION}.jar wget --no-cache ${MC_SERVER_FILE} -O /MCserver/forge-${MC_VERSION}-${FORGE_VERSION}.zip
# chmod +x /MCserver/server_forge-${MC_VERSION}-${FORGE_VERSION}.jar unzip /MCserver/forge-${MC_VERSION}-${FORGE_VERSION}.zip /MCserver
# java -jar /MCserver/server_forge-${MC_VERSION}-${FORGE_VERSION}.jar --installServer > /MCserver
fi fi
sleep 1 sleep 1
@@ -56,7 +55,7 @@ fi
sleep 1 sleep 1
# Check for needed files # Check for needed files
if [ -e /MCserver/${EULA_FILE} ] if [ -e /MCserver/eula.txt ]
then then
echo " " echo " "
echo "INFO ! eula.txt found ... will use existing file." echo "INFO ! eula.txt found ... will use existing file."
@@ -66,7 +65,7 @@ if [ -e /MCserver/${EULA_FILE} ]
wget --no-cache ${EULA_FILE} -O /MCserver/eula.txt wget --no-cache ${EULA_FILE} -O /MCserver/eula.txt
fi fi
if [ -e /MCserver/${OPS_FILE} ] if [ -e /MCserver/ops.json ]
then then
echo " " echo " "
echo "INFO ! ops.json found ... will use existing file." echo "INFO ! ops.json found ... will use existing file."
@@ -76,7 +75,7 @@ if [ -e /MCserver/${OPS_FILE} ]
wget --no-cache ${OPS_FILE} -O /MCserver/ops.json wget --no-cache ${OPS_FILE} -O /MCserver/ops.json
fi fi
if [ -e /MCserver/${WHITELIST_FILE} ] if [ -e /MCserver/whitelist.json ]
then then
echo " " echo " "
echo "INFO ! whitelist.json found ... will use existing file." echo "INFO ! whitelist.json found ... will use existing file."
@@ -86,7 +85,7 @@ if [ -e /MCserver/${WHITELIST_FILE} ]
wget --no-cache ${WHITELIST_FILE} -O /MCserver/whitelist.json wget --no-cache ${WHITELIST_FILE} -O /MCserver/whitelist.json
fi fi
if [ -e /MCserver/${SERVER_PROPERTIES} ] if [ -e /MCserver/server.properties ]
then then
echo " " echo " "
echo "INFO ! server.properties found ... will use existing file." echo "INFO ! server.properties found ... will use existing file."
@@ -101,14 +100,13 @@ sleep 1
# Set permissions. # Set permissions.
chown 99:100 -R /MCserver chown 99:100 -R /MCserver
chmod 777 -R /MCserver chmod 777 -R /MCserver
chmod +x /MCserver/run_${MC_VERSION}.sh chmod +x /MCserver/run.sh
chmod +x /MCserver/server_forge-${MC_VERSION}-${FORGE_VERSION}.jar
sleep 1 sleep 1
# Run Minecraft server. # Run Minecraft server.
echo " " echo " "
echo "INFO ! Starting Minecraft Server ${MC_VERSION}" echo "INFO ! Starting Minecraft Server ${MC_VERSION}"
exec /MCserver/run_${MC_VERSION}.sh --dataPath=/MCserver exec /MCserver/run.sh --dataPath=/MCserver
exit exit

View File

@@ -6,15 +6,11 @@ MC_VERSION=1.19.3
FORGE_VERSION=44.1.0 FORGE_VERSION=44.1.0
cd /MCserver cd /MCserver
JAR=./forge-${MC_VERSION}-${FORGE_VERSION}.jar
chmod +x server_forge-${MC_VERSION}-${FORGE_VERSION}.jar while [ true ]; do
java -jar server_forge-${MC_VERSION}-${FORGE_VERSION}.jar --installServer > /MCserver java -Xmx4G -Xms1024M -Xmn1G -jar $JAR nogui
if [ $? -eq 0 ]; then
# JAR=./server_forge-${MC_VERSION}-${FORGE_VERSION}.jar break
fi
# while [ true ]; do done
# java -Xmx4G -Xms1024M -Xmn1G -jar $JAR nogui
# if [ $? -eq 0 ]; then
# break
# fi
# done