From 9dd6d6608325b00c03311c12d3dc9714f7e0d38c Mon Sep 17 00:00:00 2001 From: fithwum <34775371+fithwum@users.noreply.github.com> Date: Thu, 23 Mar 2023 06:15:09 -0700 Subject: [PATCH] update --- forge/forge-1.19.3/files/Install_Script.sh | 80 ++++++++++++---------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/forge/forge-1.19.3/files/Install_Script.sh b/forge/forge-1.19.3/files/Install_Script.sh index 6a88a1f..486b7b1 100644 --- a/forge/forge-1.19.3/files/Install_Script.sh +++ b/forge/forge-1.19.3/files/Install_Script.sh @@ -14,6 +14,10 @@ MC_VERSION=1.19.3 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_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 +OPS_FILE=https://raw.githubusercontent.com/fithwum/minecraft/master/forge/forge-${MC_VERSION}/files/ops.json +WHITELIST_FILE=https://raw.githubusercontent.com/fithwum/minecraft/master/forge/forge-${MC_VERSION}/files/whitelist.json +SERVER_PROPERTIES=https://raw.githubusercontent.com/fithwum/minecraft/master/forge/forge-${MC_VERSION}/files/server.properties # Main install (Debian). # Check for files in /MCserver and download if needed. @@ -50,45 +54,45 @@ fi sleep 1 -# 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 - -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 +# Check for needed files +if [ -e /MCserver/${EULA_FILE} ] + then 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 -else - echo " " - echo "WARNING ! Something went wrong, please check EULA variable" + echo "INFO ! eula.txt 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 +fi + +if [ -e /MCserver/${OPS_FILE} ] + 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 +fi + +if [ -e /MCserver/${WHITELIST_FILE} ] + then + 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 +fi + +if [ -e /MCserver/${SERVER_PROPERTIES} ] + then + echo " " + echo "INFO ! server.properties found ... will use existing file." + else + echo " " + echo "WARNING ! server.properties is missing ... will download now." + wget --no-cache ${SERVER_PROPERTIES} -O /MCserver/server.properties fi sleep 1