update
All checks were successful
Build and Push Minecraft Docker Images on Debian-base update / poll-debian-base-and-detect-changes (push) Successful in 54s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-fabric (push) Successful in 15s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-neoforged (push) Successful in 1m47s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push fabric (push) Successful in 2m23s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push vanilla (push) Successful in 14s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push neoforged (push) Successful in 3m10s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-vanilla (push) Successful in 1m47s
Build and Push Minecraft Docker Images on Debian-base update / generate-changelogs (push) Successful in 9s
Build and Push Minecraft Docker Images on Debian-base update / generate-build-info (push) Successful in 1m0s
All checks were successful
Build and Push Minecraft Docker Images on Debian-base update / poll-debian-base-and-detect-changes (push) Successful in 54s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-fabric (push) Successful in 15s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-neoforged (push) Successful in 1m47s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push fabric (push) Successful in 2m23s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push vanilla (push) Successful in 14s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push neoforged (push) Successful in 3m10s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-vanilla (push) Successful in 1m47s
Build and Push Minecraft Docker Images on Debian-base update / generate-changelogs (push) Successful in 9s
Build and Push Minecraft Docker Images on Debian-base update / generate-build-info (push) Successful in 1m0s
This commit is contained in:
@@ -2,71 +2,101 @@
|
||||
# Copyright (c) 2022 fithwum
|
||||
# All rights reserved
|
||||
|
||||
# Variables.
|
||||
echo " "
|
||||
echo "INFO ! Checking for latest Minecraft Server version."
|
||||
MC_VERSION=1.19.2
|
||||
# Main Install Links
|
||||
INSTALLER_FILE=https://maven.neoforged.net/releases/net/neoforged/neoforge/$NEOFORGED_VERSION-beta/neoforge-$NEOFORGED_VERSION-beta-installer.jar
|
||||
SERVER_FILE=https://github.com/neoforged/ServerStarterJar/releases/download/$SERVER_VERSION/server.jar
|
||||
MC_RUN_FILE=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/fabric/run.sh
|
||||
|
||||
EULA_FILE=https://raw.githubusercontent.com/fithwum/minecraft/refs/heads/master/forge/forge-${MC_VERSION}/files/eula.txt
|
||||
OPS_FILE=https://raw.githubusercontent.com/fithwum/minecraft/refs/heads/master/forge/forge-${MC_VERSION}/files/ops.json
|
||||
WHITELIST_FILE=https://raw.githubusercontent.com/fithwum/minecraft/refs/heads/master/forge/forge-${MC_VERSION}/files/whitelist.json
|
||||
rm -fr /MCserver/run_*.sh
|
||||
|
||||
# Main install (Debian).
|
||||
# Check for files in /MCserver and download if needed.
|
||||
# Looking for run-forge_${MC_VERSION}.sh
|
||||
if [ -e /MCserver/run-forge_${MC_VERSION}.sh ]
|
||||
# Check for server files and download if needed.
|
||||
if [ -e /MCserver/server-$NEOFORGED_VERSION.jar ]
|
||||
then
|
||||
echo " "
|
||||
echo "INFO ! run-forge_${MC_VERSION}.sh found ... will use existing file."
|
||||
echo "INFO ! server-$NEOFORGED_VERSION.jar found starting now."
|
||||
else
|
||||
echo " "
|
||||
echo "WARNING ! run-forge_${MC_VERSION_OLD}.sh is out of date/missing ... will download now."
|
||||
mv /MCserver/run.sh /MCserver/run-forge_${MC_VERSION}.sh
|
||||
echo "WARNING ! server-$NEOFORGED_VERSION.jar is out of date/missing ... will download now."
|
||||
echo " "
|
||||
echo "INFO ! Cleaning old files."
|
||||
rm -fr /MCserver/neoforge-*.jar /MCserver/server-*.jar
|
||||
wget --no-cache --show-progress --progress=bar:force:noscroll $INSTALLER_FILE -O /MCserver/neoforge-$NEOFORGED_VERSION-beta-installer.jar
|
||||
java -jar neoforge-$NEOFORGED_VERSION-beta-installer.jar --installServer
|
||||
wget --no-cache --show-progress --progress=bar:force:noscroll $SERVER_FILE -O /MCserver/server-$NEOFORGED_VERSION.jar
|
||||
fi
|
||||
|
||||
# Check for needed files
|
||||
if [ -e /MCserver/eula.txt ]
|
||||
sleep 1
|
||||
|
||||
# Looking for run.sh
|
||||
if [ -e /MCserver/run-$NEOFORGED_VERSION.sh ]
|
||||
then
|
||||
echo " "
|
||||
echo "INFO ! eula.txt found ... will use existing file."
|
||||
echo "INFO ! run-$NEOFORGED_VERSION.sh found ... will use existing file."
|
||||
else
|
||||
echo " "
|
||||
echo "WARNING ! eula.txt is missing ... will download now."
|
||||
wget --no-cache ${EULA_FILE} -O /MCserver/eula.txt
|
||||
echo "WARNING ! run-$NEOFORGED_VERSION.sh is out of date/missing ... will download now."
|
||||
rm -fr /MCserver/run-*.sh
|
||||
wget --no-cache --show-progress --progress=bar:force:noscroll $MC_RUN_FILE -O /MCserver/run-$NEOFORGED_VERSION.sh
|
||||
fi
|
||||
|
||||
if [ -e /MCserver/ops.json ]
|
||||
then
|
||||
echo " "
|
||||
echo "INFO ! ops.json found ... will use existing file."
|
||||
else
|
||||
echo " "
|
||||
echo "WARNING ! ops.json is missing ... will download now."
|
||||
wget --no-cache ${OPS_FILE} -O /MCserver/ops.json
|
||||
# Check for EULA
|
||||
if [ ! -f /MCserver/eula.txt ]; then
|
||||
:
|
||||
else
|
||||
if [ "$ACCEPT_EULA" == "false" ]; then
|
||||
if grep -rq 'eula=true' /MCserver/eula.txt; then
|
||||
sed -i '/eula=true/c\eula=false' /MCserver/eula.txt
|
||||
fi
|
||||
echo " "
|
||||
echo "WARNING ! EULA not accepted, you must accept the EULA"
|
||||
echo " to start the Server, putting server in sleep mode"
|
||||
sleep infinity
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -e /MCserver/whitelist.json ]
|
||||
then
|
||||
sleep 1
|
||||
|
||||
if [ ! -f /MCserver/eula.txt ]; then
|
||||
echo " "
|
||||
echo "WARNING ! EULA not found please stand by..."
|
||||
sleep 5
|
||||
fi
|
||||
if [ "$ACCEPT_EULA" == "true" ]; then
|
||||
if grep -rq 'eula=false' /MCserver/eula.txt; then
|
||||
sed -i '/eula=false/c\eula=true' /MCserver/eula.txt
|
||||
echo " "
|
||||
echo "INFO ! whitelist.json found ... will use existing file."
|
||||
else
|
||||
echo " "
|
||||
echo "WARNING ! whitelist.json is missing ... will download now."
|
||||
wget --no-cache ${WHITELIST_FILE} -O /MCserver/whitelist.json
|
||||
echo "INFO ! EULA accepted, server restarting, please wait..."
|
||||
sleep 1
|
||||
exec /MCserver/run-$NEOFORGED_VERSION.sh --dataPath=/MCserver
|
||||
exit 0
|
||||
fi
|
||||
elif [ "$ACCEPT_EULA" == "false" ]; then
|
||||
echo " "
|
||||
echo "WARNING ! EULA not accepted, you must accept the EULA"
|
||||
echo " to start the Server, putting server in sleep mode"
|
||||
sleep infinity
|
||||
else
|
||||
echo " "
|
||||
echo "WARNING ! Something went wrong, please check EULA variable"
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
echo "INFO ! Setting game port."
|
||||
sed -i '/server-port='*'/c\server-port='$GAME_PORT'' /MCserver/server.properties
|
||||
sleep 1
|
||||
|
||||
# Set permissions.
|
||||
chown 99:100 -R /MCserver
|
||||
chmod 777 -R /MCserver
|
||||
chmod +x /MCserver/run-forge_${MC_VERSION}.sh
|
||||
chmod +x /MCserver/run-$NEOFORGED_VERSION.sh
|
||||
chmod +x /MCserver/neoforge-$NEOFORGED_VERSION-beta-installer.jar
|
||||
|
||||
sleep 1
|
||||
|
||||
# Run Minecraft server.
|
||||
echo " "
|
||||
echo "INFO ! Starting Minecraft Server ${MC_VERSION}"
|
||||
exec /MCserver/run-forge_${MC_VERSION}.sh --dataPath=/MCserver
|
||||
echo "INFO ! Starting Minecraft Server $NEOFORGED_VERSION"
|
||||
exec /MCserver/run-$NEOFORGED_VERSION.sh --dataPath=/MCserver
|
||||
|
||||
exit
|
||||
exit
|
||||
Reference in New Issue
Block a user