variable fixes
All checks were successful
Build and Push Minecraft Docker Images on Debian-base update / poll-debian-base-and-detect-changes (push) Successful in 8s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push fabric (push) Successful in 50s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push neoforged (push) Successful in 54s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push forge (push) Successful in 59s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push bukkit (push) Successful in 1m56s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-forge (push) Successful in 1m37s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-vanilla (push) Successful in 28s
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 testing-bukkit (push) Successful in 2m51s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push testing-fabric (push) Successful in 2m47s
Build and Push Minecraft Docker Images on Debian-base update / Build and Push vanilla (push) Successful in 53s
Build and Push Minecraft Docker Images on Debian-base update / generate-changelogs (push) Successful in 7s
Build and Push Minecraft Docker Images on Debian-base update / generate-build-info (push) Successful in 3m43s

This commit is contained in:
2025-12-20 07:38:23 -08:00
parent 6ea2102d4c
commit 95845becb5
10 changed files with 235 additions and 391 deletions

View File

@@ -3,6 +3,8 @@
# All rights reserved
MC_DIR=/MCserver
EULA_FILE=$MC_DIR/eula.txt
EULA_MARKER=$MC_DIR/.eula_accepted
# Main Install Links
INSTALLER_FILE=https://cdn.getbukkit.org/craftbukkit/craftbukkit-$MC_VERSION.jar
@@ -43,44 +45,31 @@ if [ -f $MC_DIR/server.properties ]; then
sed -i '/server-port='*'/c\server-port='$GAME_PORT'' $MC_DIR/server.properties
fi
# Check for EULA
if [ ! -f $MC_DIR/eula.txt ]; then
:
else
if [ "$ACCEPT_EULA" == "false" ]; then
if grep -rq 'eula=true' $MC_DIR/eula.txt; then
sed -i '/eula=true/c\eula=false' $MC_DIR/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
# Wait briefly for installer/server to generate eula.txt
if [ ! -f "$EULA_FILE" ] && [ ! -f "$EULA_MARKER" ]; then
echo "INFO ! Waiting for EULA generation..."
sleep 5
fi
if [ ! -f $MC_DIR/eula.txt ]; then
echo " "
echo "WARNING ! EULA not found please stand by..."
sleep 5
# If EULA already accepted once, never touch it again
if [ -f "$EULA_MARKER" ]; then
echo "INFO ! EULA previously accepted"
return 0 2>/dev/null || true
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
# First-time decision
if [ "$ACCEPT_EULA" = "true" ]; then
echo "INFO ! Accepting EULA (one-time)"
sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null \
|| echo "eula=true" > "$EULA_FILE"
touch "$EULA_MARKER"
elif [ "$ACCEPT_EULA" = "false" ]; then
echo "WARNING ! EULA not accepted on first run"
echo "WARNING ! Set ACCEPT_EULA=true to proceed"
sleep infinity
else
echo " "
echo "WARNING ! Something went wrong, please check EULA variable"
echo "ERROR ! ACCEPT_EULA must be set to true or false on first run"
sleep infinity
fi
# Set permissions.

View File

@@ -2,13 +2,17 @@
# Copyright (c) 2022 fithwum
# All rights reserved
MC_DIR=/MCserver
EULA_FILE=$MC_DIR/eula.txt
EULA_MARKER=$MC_DIR/.eula_accepted
# Main Install Links
SERVER_FILE=https://meta.fabricmc.net/v2/versions/loader/$MC_VERSION/$FABRIC_VERSION/$INSTALLER_VERSION/server/jar
MC_RUN_FILE=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/fabric/run.sh
# Main install (Debian).
# Check for server files and download if needed.
if [ -e /MCserver/fabric-$MC_VERSION-$FABRIC_VERSION.jar ]
if [ -e $MC_DIR/fabric-$MC_VERSION-$FABRIC_VERSION.jar ]
then
echo " "
echo "INFO ! fabric-$MC_VERSION-$FABRIC_VERSION.jar found starting now."
@@ -17,23 +21,23 @@ if [ -e /MCserver/fabric-$MC_VERSION-$FABRIC_VERSION.jar ]
echo "WARNING ! fabric-$MC_VERSION-$FABRIC_VERSION.jar is out of date/missing ... will download now."
echo " "
echo "INFO ! Cleaning old files."
mkdir /MCserver/old-server-versions
mv /MCserver/fabric-*-*.jar /MCserver/old-server-versions/
wget --no-cache --show-progress --progress=bar:force:noscroll $SERVER_FILE -O /MCserver/fabric-$MC_VERSION-$FABRIC_VERSION.jar
chmod +x /MCserver/fabric-$MC_VERSION-$FABRIC_VERSION.jar
mkdir $MC_DIR/old-server-versions
mv $MC_DIR/fabric-*-*.jar $MC_DIR/old-server-versions/
wget --no-cache --show-progress --progress=bar:force:noscroll $SERVER_FILE -O $MC_DIR/fabric-$MC_VERSION-$FABRIC_VERSION.jar
chmod +x $MC_DIR/fabric-$MC_VERSION-$FABRIC_VERSION.jar
fi
# Looking for run.sh
if [ -e /MCserver/run-$MC_VERSION.sh ]
if [ -e $MC_DIR/run-$MC_VERSION.sh ]
then
echo " "
echo "INFO ! run-$MC_VERSION.sh found ... will use existing file."
else
echo " "
echo "WARNING ! run-$MC_VERSION.sh is out of date/missing ... will download now."
mv /MCserver/run-*.sh /MCserver/old-server-versions/
wget --no-cache --show-progress --progress=bar:force:noscroll $MC_RUN_FILE -O /MCserver/run-$MC_VERSION.sh
chmod +x /MCserver/run-$MC_VERSION.sh
mv $MC_DIR/run-*.sh $MC_DIR/old-server-versions/
wget --no-cache --show-progress --progress=bar:force:noscroll $MC_RUN_FILE -O $MC_DIR/run-$MC_VERSION.sh
chmod +x $MC_DIR/run-$MC_VERSION.sh
fi
echo "INFO ! Setting game port."
@@ -41,54 +45,42 @@ if [ -f $MC_DIR/server.properties ]; then
sed -i '/server-port='*'/c\server-port='$GAME_PORT'' $MC_DIR/server.properties
fi
# 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
# Wait briefly for installer/server to generate eula.txt
if [ ! -f "$EULA_FILE" ] && [ ! -f "$EULA_MARKER" ]; then
echo "INFO ! Waiting for EULA generation..."
sleep 5
fi
if [ ! -f /MCserver/eula.txt ]; then
echo " "
echo "WARNING ! EULA not found please stand by..."
sleep 5
# If EULA already accepted once, never touch it again
if [ -f "$EULA_MARKER" ]; then
echo "INFO ! EULA previously accepted"
return 0 2>/dev/null || true
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 ! EULA accepted, server restarting, please wait..."
sleep 1
exec /MCserver/run-$MC_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
# First-time decision
if [ "$ACCEPT_EULA" = "true" ]; then
echo "INFO ! Accepting EULA (one-time)"
sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null \
|| echo "eula=true" > "$EULA_FILE"
touch "$EULA_MARKER"
elif [ "$ACCEPT_EULA" = "false" ]; then
echo "WARNING ! EULA not accepted on first run"
echo "WARNING ! Set ACCEPT_EULA=true to proceed"
sleep infinity
else
echo " "
echo "WARNING ! Something went wrong, please check EULA variable"
echo "ERROR ! ACCEPT_EULA must be set to true or false on first run"
sleep infinity
fi
# Set permissions.
chown 99:100 -R /MCserver
chmod 777 -R /MCserver
chown 99:100 -R $MC_DIR
chmod 777 -R $MC_DIR
sleep 1
# Run Minecraft server.
echo " "
echo "INFO ! Starting Minecraft Server $MC_VERSION"
exec /MCserver/run-$MC_VERSION.sh --dataPath=/MCserver
exec $MC_DIR/run-$MC_VERSION.sh --dataPath=$MC_DIR
exit

View File

@@ -3,6 +3,8 @@
# All rights reserved
MC_DIR=/MCserver
EULA_FILE=$MC_DIR/eula.txt
EULA_MARKER=$MC_DIR/.eula_accepted
# Main Install Links
INSTALLER_FILE=https://maven.minecraftforge.net/net/minecraftforge/forge/$MC_VERSION-$FORGE_VERSION/forge-$MC_VERSION-$FORGE_VERSION-installer.jar
@@ -41,44 +43,31 @@ cat > $MC_DIR/user_jvm_args.txt <<EOF
EOF
[ -n "$XMN_SIZE" ] && echo "-Xmn${XMN_SIZE}" >> $MC_DIR/user_jvm_args.txt
# Check for EULA
if [ ! -f $MC_DIR/eula.txt ]; then
:
else
if [ "$ACCEPT_EULA" == "false" ]; then
if grep -rq 'eula=true' $MC_DIR/eula.txt; then
sed -i '/eula=true/c\eula=false' $MC_DIR/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
# Wait briefly for installer/server to generate eula.txt
if [ ! -f "$EULA_FILE" ] && [ ! -f "$EULA_MARKER" ]; then
echo "INFO ! Waiting for EULA generation..."
sleep 5
fi
if [ ! -f $MC_DIR/eula.txt ]; then
echo " "
echo "WARNING ! EULA not found please stand by..."
sleep 5
# If EULA already accepted once, never touch it again
if [ -f "$EULA_MARKER" ]; then
echo "INFO ! EULA previously accepted"
return 0 2>/dev/null || true
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
# First-time decision
if [ "$ACCEPT_EULA" = "true" ]; then
echo "INFO ! Accepting EULA (one-time)"
sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null \
|| echo "eula=true" > "$EULA_FILE"
touch "$EULA_MARKER"
elif [ "$ACCEPT_EULA" = "false" ]; then
echo "WARNING ! EULA not accepted on first run"
echo "WARNING ! Set ACCEPT_EULA=true to proceed"
sleep infinity
else
echo " "
echo "WARNING ! Something went wrong, please check EULA variable"
echo "ERROR ! ACCEPT_EULA must be set to true or false on first run"
sleep infinity
fi
# Set permissions.

View File

@@ -3,6 +3,8 @@
# All rights reserved
MC_DIR=/MCserver
EULA_FILE=$MC_DIR/eula.txt
EULA_MARKER=$MC_DIR/.eula_accepted
# Main Install Links
INSTALLER_FILE=https://maven.neoforged.net/releases/net/neoforged/neoforge/$NEOFORGED_VERSION/neoforge-$NEOFORGED_VERSION-installer.jar
@@ -40,44 +42,31 @@ cat > $MC_DIR/user_jvm_args.txt <<EOF
EOF
[ -n "$XMN_SIZE" ] && echo "-Xmn${XMN_SIZE}" >> $MC_DIR/user_jvm_args.txt
# Check for EULA
if [ ! -f $MC_DIR/eula.txt ]; then
:
else
if [ "$ACCEPT_EULA" == "false" ]; then
if grep -rq 'eula=true' $MC_DIR/eula.txt; then
sed -i '/eula=true/c\eula=false' $MC_DIR/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
# Wait briefly for installer/server to generate eula.txt
if [ ! -f "$EULA_FILE" ] && [ ! -f "$EULA_MARKER" ]; then
echo "INFO ! Waiting for EULA generation..."
sleep 5
fi
if [ ! -f $MC_DIR/eula.txt ]; then
echo " "
echo "WARNING ! EULA not found please stand by..."
sleep 5
# If EULA already accepted once, never touch it again
if [ -f "$EULA_MARKER" ]; then
echo "INFO ! EULA previously accepted"
return 0 2>/dev/null || true
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-$NEOFORGED_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
# First-time decision
if [ "$ACCEPT_EULA" = "true" ]; then
echo "INFO ! Accepting EULA (one-time)"
sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null \
|| echo "eula=true" > "$EULA_FILE"
touch "$EULA_MARKER"
elif [ "$ACCEPT_EULA" = "false" ]; then
echo "WARNING ! EULA not accepted on first run"
echo "WARNING ! Set ACCEPT_EULA=true to proceed"
sleep infinity
else
echo " "
echo "WARNING ! Something went wrong, please check EULA variable"
echo "ERROR ! ACCEPT_EULA must be set to true or false on first run"
sleep infinity
fi
# Set permissions.

View File

@@ -3,6 +3,8 @@
# All rights reserved
MC_DIR=/MCserver
EULA_FILE=$MC_DIR/eula.txt
EULA_MARKER=$MC_DIR/.eula_accepted
# Main Install Links
INSTALLER_FILE=https://cdn.getbukkit.org/craftbukkit/craftbukkit-$MC_VERSION.jar
@@ -43,44 +45,31 @@ if [ -f $MC_DIR/server.properties ]; then
sed -i '/server-port='*'/c\server-port='$GAME_PORT'' $MC_DIR/server.properties
fi
# Check for EULA
if [ ! -f $MC_DIR/eula.txt ]; then
:
else
if [ "$ACCEPT_EULA" == "false" ]; then
if grep -rq 'eula=true' $MC_DIR/eula.txt; then
sed -i '/eula=true/c\eula=false' $MC_DIR/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
# Wait briefly for installer/server to generate eula.txt
if [ ! -f "$EULA_FILE" ] && [ ! -f "$EULA_MARKER" ]; then
echo "INFO ! Waiting for EULA generation..."
sleep 5
fi
if [ ! -f $MC_DIR/eula.txt ]; then
echo " "
echo "WARNING ! EULA not found please stand by..."
sleep 5
# If EULA already accepted once, never touch it again
if [ -f "$EULA_MARKER" ]; then
echo "INFO ! EULA previously accepted"
return 0 2>/dev/null || true
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
# First-time decision
if [ "$ACCEPT_EULA" = "true" ]; then
echo "INFO ! Accepting EULA (one-time)"
sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null \
|| echo "eula=true" > "$EULA_FILE"
touch "$EULA_MARKER"
elif [ "$ACCEPT_EULA" = "false" ]; then
echo "WARNING ! EULA not accepted on first run"
echo "WARNING ! Set ACCEPT_EULA=true to proceed"
sleep infinity
else
echo " "
echo "WARNING ! Something went wrong, please check EULA variable"
echo "ERROR ! ACCEPT_EULA must be set to true or false on first run"
sleep infinity
fi
# Set permissions.

View File

@@ -2,13 +2,17 @@
# Copyright (c) 2022 fithwum
# All rights reserved
MC_DIR=/MCserver
EULA_FILE=$MC_DIR/eula.txt
EULA_MARKER=$MC_DIR/.eula_accepted
# Main Install Links
SERVER_FILE=https://meta.fabricmc.net/v2/versions/loader/$MC_VERSION/$FABRIC_VERSION/$INSTALLER_VERSION/server/jar
MC_RUN_FILE=https://gitea.fithwum.tech/fithwum/minecraft/raw/branch/master/fabric/run.sh
# Main install (Debian).
# Check for server files and download if needed.
if [ -e /MCserver/fabric-$MC_VERSION-$FABRIC_VERSION.jar ]
if [ -e $MC_DIR/fabric-$MC_VERSION-$FABRIC_VERSION.jar ]
then
echo " "
echo "INFO ! fabric-$MC_VERSION-$FABRIC_VERSION.jar found starting now."
@@ -17,23 +21,23 @@ if [ -e /MCserver/fabric-$MC_VERSION-$FABRIC_VERSION.jar ]
echo "WARNING ! fabric-$MC_VERSION-$FABRIC_VERSION.jar is out of date/missing ... will download now."
echo " "
echo "INFO ! Cleaning old files."
mkdir /MCserver/old-server-versions
mv /MCserver/fabric-*-*.jar /MCserver/old-server-versions/
wget --no-cache --show-progress --progress=bar:force:noscroll $SERVER_FILE -O /MCserver/fabric-$MC_VERSION-$FABRIC_VERSION.jar
chmod +x /MCserver/fabric-$MC_VERSION-$FABRIC_VERSION.jar
mkdir $MC_DIR/old-server-versions
mv $MC_DIR/fabric-*-*.jar $MC_DIR/old-server-versions/
wget --no-cache --show-progress --progress=bar:force:noscroll $SERVER_FILE -O $MC_DIR/fabric-$MC_VERSION-$FABRIC_VERSION.jar
chmod +x $MC_DIR/fabric-$MC_VERSION-$FABRIC_VERSION.jar
fi
# Looking for run.sh
if [ -e /MCserver/run-$MC_VERSION.sh ]
if [ -e $MC_DIR/run-$MC_VERSION.sh ]
then
echo " "
echo "INFO ! run-$MC_VERSION.sh found ... will use existing file."
else
echo " "
echo "WARNING ! run-$MC_VERSION.sh is out of date/missing ... will download now."
mv /MCserver/run-*.sh /MCserver/old-server-versions/
wget --no-cache --show-progress --progress=bar:force:noscroll $MC_RUN_FILE -O /MCserver/run-$MC_VERSION.sh
chmod +x /MCserver/run-$MC_VERSION.sh
mv $MC_DIR/run-*.sh $MC_DIR/old-server-versions/
wget --no-cache --show-progress --progress=bar:force:noscroll $MC_RUN_FILE -O $MC_DIR/run-$MC_VERSION.sh
chmod +x $MC_DIR/run-$MC_VERSION.sh
fi
echo "INFO ! Setting game port."
@@ -41,54 +45,42 @@ if [ -f $MC_DIR/server.properties ]; then
sed -i '/server-port='*'/c\server-port='$GAME_PORT'' $MC_DIR/server.properties
fi
# 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
# Wait briefly for installer/server to generate eula.txt
if [ ! -f "$EULA_FILE" ] && [ ! -f "$EULA_MARKER" ]; then
echo "INFO ! Waiting for EULA generation..."
sleep 5
fi
if [ ! -f /MCserver/eula.txt ]; then
echo " "
echo "WARNING ! EULA not found please stand by..."
sleep 5
# If EULA already accepted once, never touch it again
if [ -f "$EULA_MARKER" ]; then
echo "INFO ! EULA previously accepted"
return 0 2>/dev/null || true
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 ! EULA accepted, server restarting, please wait..."
sleep 1
exec /MCserver/run-$MC_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
# First-time decision
if [ "$ACCEPT_EULA" = "true" ]; then
echo "INFO ! Accepting EULA (one-time)"
sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null \
|| echo "eula=true" > "$EULA_FILE"
touch "$EULA_MARKER"
elif [ "$ACCEPT_EULA" = "false" ]; then
echo "WARNING ! EULA not accepted on first run"
echo "WARNING ! Set ACCEPT_EULA=true to proceed"
sleep infinity
else
echo " "
echo "WARNING ! Something went wrong, please check EULA variable"
echo "ERROR ! ACCEPT_EULA must be set to true or false on first run"
sleep infinity
fi
# Set permissions.
chown 99:100 -R /MCserver
chmod 777 -R /MCserver
chown 99:100 -R $MC_DIR
chmod 777 -R $MC_DIR
sleep 1
# Run Minecraft server.
echo " "
echo "INFO ! Starting Minecraft Server $MC_VERSION"
exec /MCserver/run-$MC_VERSION.sh --dataPath=/MCserver
exec $MC_DIR/run-$MC_VERSION.sh --dataPath=$MC_DIR
exit

View File

@@ -3,6 +3,8 @@
# All rights reserved
MC_DIR=/MCserver
EULA_FILE=$MC_DIR/eula.txt
EULA_MARKER=$MC_DIR/.eula_accepted
# Main Install Links
INSTALLER_FILE=https://maven.minecraftforge.net/net/minecraftforge/forge/$MC_VERSION-$FORGE_VERSION/forge-$MC_VERSION-$FORGE_VERSION-installer.jar
@@ -41,44 +43,31 @@ cat > $MC_DIR/user_jvm_args.txt <<EOF
EOF
[ -n "$XMN_SIZE" ] && echo "-Xmn${XMN_SIZE}" >> $MC_DIR/user_jvm_args.txt
# Check for EULA
if [ ! -f $MC_DIR/eula.txt ]; then
:
else
if [ "$ACCEPT_EULA" == "false" ]; then
if grep -rq 'eula=true' $MC_DIR/eula.txt; then
sed -i '/eula=true/c\eula=false' $MC_DIR/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
# Wait briefly for installer/server to generate eula.txt
if [ ! -f "$EULA_FILE" ] && [ ! -f "$EULA_MARKER" ]; then
echo "INFO ! Waiting for EULA generation..."
sleep 5
fi
if [ ! -f $MC_DIR/eula.txt ]; then
echo " "
echo "WARNING ! EULA not found please stand by..."
sleep 5
# If EULA already accepted once, never touch it again
if [ -f "$EULA_MARKER" ]; then
echo "INFO ! EULA previously accepted"
return 0 2>/dev/null || true
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
# First-time decision
if [ "$ACCEPT_EULA" = "true" ]; then
echo "INFO ! Accepting EULA (one-time)"
sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null \
|| echo "eula=true" > "$EULA_FILE"
touch "$EULA_MARKER"
elif [ "$ACCEPT_EULA" = "false" ]; then
echo "WARNING ! EULA not accepted on first run"
echo "WARNING ! Set ACCEPT_EULA=true to proceed"
sleep infinity
else
echo " "
echo "WARNING ! Something went wrong, please check EULA variable"
echo "ERROR ! ACCEPT_EULA must be set to true or false on first run"
sleep infinity
fi
# Set permissions.

View File

@@ -3,6 +3,8 @@
# All rights reserved
MC_DIR=/MCserver
EULA_FILE=$MC_DIR/eula.txt
EULA_MARKER=$MC_DIR/.eula_accepted
# Main Install Links
INSTALLER_FILE=https://maven.neoforged.net/releases/net/neoforged/neoforge/$NEOFORGED_VERSION/neoforge-$NEOFORGED_VERSION-installer.jar
@@ -40,44 +42,31 @@ cat > $MC_DIR/user_jvm_args.txt <<EOF
EOF
[ -n "$XMN_SIZE" ] && echo "-Xmn${XMN_SIZE}" >> $MC_DIR/user_jvm_args.txt
# Check for EULA
if [ ! -f $MC_DIR/eula.txt ]; then
:
else
if [ "$ACCEPT_EULA" == "false" ]; then
if grep -rq 'eula=true' $MC_DIR/eula.txt; then
sed -i '/eula=true/c\eula=false' $MC_DIR/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
# Wait briefly for installer/server to generate eula.txt
if [ ! -f "$EULA_FILE" ] && [ ! -f "$EULA_MARKER" ]; then
echo "INFO ! Waiting for EULA generation..."
sleep 5
fi
if [ ! -f $MC_DIR/eula.txt ]; then
echo " "
echo "WARNING ! EULA not found please stand by..."
sleep 5
# If EULA already accepted once, never touch it again
if [ -f "$EULA_MARKER" ]; then
echo "INFO ! EULA previously accepted"
return 0 2>/dev/null || true
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-$NEOFORGED_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
# First-time decision
if [ "$ACCEPT_EULA" = "true" ]; then
echo "INFO ! Accepting EULA (one-time)"
sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null \
|| echo "eula=true" > "$EULA_FILE"
touch "$EULA_MARKER"
elif [ "$ACCEPT_EULA" = "false" ]; then
echo "WARNING ! EULA not accepted on first run"
echo "WARNING ! Set ACCEPT_EULA=true to proceed"
sleep infinity
else
echo " "
echo "WARNING ! Something went wrong, please check EULA variable"
echo "ERROR ! ACCEPT_EULA must be set to true or false on first run"
sleep infinity
fi
# Set permissions.

View File

@@ -46,66 +46,6 @@ if [ -f $MC_DIR/server.properties ]; then
sed -i '/server-port='*'/c\server-port='$GAME_PORT'' $MC_DIR/server.properties
fi
# Check for EULA
# if [ ! -f $MC_DIR/eula.txt ]; then
# :
# else
# if [ "$ACCEPT_EULA" == "false" ]; then
# if grep -rq 'eula=true' $MC_DIR/eula.txt; then
# sed -i '/eula=true/c\eula=false' $MC_DIR/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 [ ! -f $MC_DIR/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' $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
# Test EULA
# if [ ! -f "$EULA_FILE" ]; then
# echo "WARNING ! EULA not found, waiting for generation..."
# sleep 5
# fi
# if [ "$ACCEPT_EULA" = "true" ]; then
# sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null
# echo "INFO ! EULA accepted"
# elif [ "$ACCEPT_EULA" = "false" ]; then
# sed -i 's/eula=true/eula=false/' "$EULA_FILE" 2>/dev/null
# echo "WARNING ! EULA not accepted, server will not start"
# sleep infinity
# else
# echo "WARNING ! ACCEPT_EULA must be set to true or false"
# sleep infinity
# fi
# Wait briefly for installer/server to generate eula.txt
if [ ! -f "$EULA_FILE" ] && [ ! -f "$EULA_MARKER" ]; then
echo "INFO ! Waiting for EULA generation..."
@@ -121,17 +61,13 @@ fi
# First-time decision
if [ "$ACCEPT_EULA" = "true" ]; then
echo "INFO ! Accepting EULA (one-time)"
sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null \
|| echo "eula=true" > "$EULA_FILE"
touch "$EULA_MARKER"
elif [ "$ACCEPT_EULA" = "false" ]; then
echo "WARNING ! EULA not accepted on first run"
echo "WARNING ! Set ACCEPT_EULA=true to proceed"
sleep infinity
else
echo "ERROR ! ACCEPT_EULA must be set to true or false on first run"
sleep infinity

View File

@@ -3,6 +3,8 @@
# All rights reserved
MC_DIR=/MCserver
EULA_FILE=$MC_DIR/eula.txt
EULA_MARKER=$MC_DIR/.eula_accepted
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')
@@ -44,43 +46,31 @@ if [ -f $MC_DIR/server.properties ]; then
sed -i '/server-port='*'/c\server-port='$GAME_PORT'' $MC_DIR/server.properties
fi
# Check for EULA
if [ ! -f $MC_DIR/eula.txt ]; then
:
else
if [ "$ACCEPT_EULA" == "false" ]; then
if grep -rq 'eula=true' $MC_DIR/eula.txt; then
sed -i '/eula=true/c\eula=false' $MC_DIR/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
# Wait briefly for installer/server to generate eula.txt
if [ ! -f "$EULA_FILE" ] && [ ! -f "$EULA_MARKER" ]; then
echo "INFO ! Waiting for EULA generation..."
sleep 5
fi
if [ ! -f $MC_DIR/eula.txt ]; then
echo " "
echo "WARNING ! EULA not found please stand by..."
sleep 5
# If EULA already accepted once, never touch it again
if [ -f "$EULA_MARKER" ]; then
echo "INFO ! EULA previously accepted"
return 0 2>/dev/null || true
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
exec $MC_DIR/run-$MC_VERSION.sh --dataPath=$MC_DIR
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
# First-time decision
if [ "$ACCEPT_EULA" = "true" ]; then
echo "INFO ! Accepting EULA (one-time)"
sed -i 's/eula=false/eula=true/' "$EULA_FILE" 2>/dev/null \
|| echo "eula=true" > "$EULA_FILE"
touch "$EULA_MARKER"
elif [ "$ACCEPT_EULA" = "false" ]; then
echo "WARNING ! EULA not accepted on first run"
echo "WARNING ! Set ACCEPT_EULA=true to proceed"
sleep infinity
else
echo " "
echo "WARNING ! Something went wrong, please check EULA variable"
echo "ERROR ! ACCEPT_EULA must be set to true or false on first run"
sleep infinity
fi
# Set permissions.