eula test
Some checks failed
Build and Push Minecraft Docker Images on Debian-base update / poll-debian-base-and-detect-changes (push) Successful in 12s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push forge (push) Successful in 1m1s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push fabric (push) Successful in 1m1s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push bukkit (push) Successful in 1m16s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-fabric (push) Successful in 16s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-bukkit (push) Successful in 1m5s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push neoforged (push) Successful in 2m6s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-neoforged (push) Successful in 50s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-forge (push) Successful in 55s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-vanilla (push) Successful in 16s
Build and Push Minecraft Docker Images on Debian-base update / generate-changelogs (push) Has been cancelled
Build and Push Minecraft Docker Images on Debian-base update / generate-build-info (push) Has been cancelled
Build and Push Minecraft Docker Images on Debian-base update / Build and Push vanilla (push) Has been cancelled

This commit is contained in:
2025-12-20 07:20:26 -08:00
parent 380d9d767f
commit 59fa516959

View File

@@ -3,6 +3,7 @@
# All rights reserved # All rights reserved
MC_DIR=/MCserver MC_DIR=/MCserver
EULA_FILE=$MC_DIR/eula.txt
VERSION_CHECK=$(curl -s "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" | grep -Pom 1 '"url": "\K[^"]*'$MC_VERSION'.json') VERSION_CHECK=$(curl -s "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" | grep -Pom 1 '"url": "\K[^"]*'$MC_VERSION'.json')
MC_SERVER_FILE=$(curl -s $VERSION_CHECK | jq --raw-output '.downloads.server.url') MC_SERVER_FILE=$(curl -s $VERSION_CHECK | jq --raw-output '.downloads.server.url')
@@ -45,42 +46,62 @@ if [ -f $MC_DIR/server.properties ]; then
fi fi
# Check for EULA # Check for EULA
if [ ! -f $MC_DIR/eula.txt ]; then # if [ ! -f $MC_DIR/eula.txt ]; then
: # :
else # else
if [ "$ACCEPT_EULA" == "false" ]; then # if [ "$ACCEPT_EULA" == "false" ]; then
if grep -rq 'eula=true' $MC_DIR/eula.txt; then # if grep -rq 'eula=true' $MC_DIR/eula.txt; then
sed -i '/eula=true/c\eula=false' $MC_DIR/eula.txt # sed -i '/eula=true/c\eula=false' $MC_DIR/eula.txt
fi # fi
echo " " # echo " "
echo "WARNING ! EULA not accepted, you must accept the EULA" # echo "WARNING ! EULA not accepted, you must accept the EULA"
echo " to start the Server, putting server in sleep mode" # echo " to start the Server, putting server in sleep mode"
sleep infinity # sleep infinity
fi # fi
fi # fi
if [ ! -f $MC_DIR/eula.txt ]; then # if [ ! -f $MC_DIR/eula.txt ]; then
echo " " # echo " "
echo "WARNING ! EULA not found please stand by..." # echo "WARNING ! EULA not found please stand by..."
# sleep 5
# fi
# if [ "$ACCEPT_EULA" == "true" ]; then
# if grep -rq 'eula=false' $MC_DIR/eula.txt; then
# sed -i '/eula=false/c\eula=true' $MC_DIR/eula.txt
# echo " "
# echo "INFO ! EULA accepted, server restarting, please wait..."
# sleep 1
# cd $MC_DIR
# exec ./run-$MC_VERSION-$FORGE_VERSION.sh nogui
# 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
if [ ! -f "$EULA_FILE" ]; then
echo "WARNING ! EULA not found, waiting for generation..."
sleep 5 sleep 5
fi fi
if [ "$ACCEPT_EULA" == "true" ]; then
if grep -rq 'eula=false' $MC_DIR/eula.txt; then if [ "$ACCEPT_EULA" = "true" ]; then
sed -i '/eula=false/c\eula=true' $MC_DIR/eula.txt sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null
echo " " echo "INFO ! EULA accepted"
echo "INFO ! EULA accepted, server restarting, please wait..."
sleep 1 elif [ "$ACCEPT_EULA" = "false" ]; then
exec $MC_DIR/run-$MC_VERSION.sh --dataPath=$MC_DIR sed -i 's/eula=true/eula=false/' "$EULA_FILE" 2>/dev/null
exit 0 echo "WARNING ! EULA not accepted, server will not start"
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 sleep infinity
else else
echo " " echo "WARNING ! ACCEPT_EULA must be set to true or false"
echo "WARNING ! Something went wrong, please check EULA variable" sleep infinity
fi fi
# Set permissions. # Set permissions.