mojira.dev
MC-299084

Whats with changing the download page?!?

So i know for myself and for a few others i have shared my simple shell script to automatically download the latest update and install it… Someone changed the download page to read from your webpage in curl:

<div data-mc-mount="codeDefinitionApp" data-mc-config-strings="{\x22downloadGlobal\x22:{\x22backgroundColor\x22:\x22MC_Bg_Core__off\u002Dblack\x22,\x22download_Text\x22:\x22Download {0} and run it with the following command:\x22,\x22theme\x22:\x22MC_Theme_Vanilla\x22,\x22downloadCmd\x22:\x22java \u002DXmx1024M \u002DXms1024M \u002Djar minecraft_server.{0}.jar nogui\x22}}">

I don’t understand why this was changed… used to just grep minecraft_server.*.jar , see if it was the same version I was running, and if not download the latest. Can someone please put it back or make another link to all the versions of java so I can grab the latest automatically and just have it scripted to install?

Thank you,

-Corry

Comments 2

#!/bin/bash
#############################################################
# Minecraft server auto update tool!
# THIS MUST BE RUN AS ROOT in ROOTS CRONTAB
#
# Crontab info for weekly checks on Wed 3AM.
# 0 3 * * 3 /opt/minecraft/update_mc.sh
# -Corry
#############################################################
CPath=/opt/minecraft
JAVA="False"
Current_Version=`ls ${CPath}/server | grep minecraft_server`
printf "This script to to see if there is a newer version of MineCraft!!\n\nChecking to see what version is available from Minecraft website\n"

MC_Version=`curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0"  https://www.minecraft.net/en-us/download/server | grep "minecraft_server" | awk -F'>' '{print $NF}' | column -t`

if [ "${MC_Version}" != "${Current_Version}" ]
then
    printf "Newer Version found...\nThe process will take roughly less than 2 of your earth minutes\nShutting down Minecraft\nChecking Java version...  "
    date +'[%H:%M:%S] [Server thread/INFO]: <System Message> Newer Version found...  The process will take roughly less than 2 of your earth minutes.  Shutting down Minecraft.' >> ${CPATH}/server/logs/latest.log
    sleep 10
    systemctl stop minecraft
    printf "Newer Version found...\nChecking Java...  "
    #update OpenJDK
    CurrentJDK=`apt list | grep ^openjdk | cut -d- -f-2 | sort -u -V | tail -1`
    LatestJDK=`apt-cache search openjdk | grep ^openjdk | cut -d- -f-2 | sort -u -V | tail -1`
    if [ "${LatestJDK}" != "${CurrentJDK}" ]
    then
        if [ "$JAVA" == "True" ] 
        then
            apt-get -y install ${LatestJDK}-jre ${LatestJDK}-jdk
	else
	    printf "Java update skipped"
        fi
    fi
    #update Minecraft
    rm ${CPath}/server/${Current_Version} ${CPath}/server/server.jar
    MCVersion=`curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0"  https://www.minecraft.net/en-us/download/server | grep 'server.jar' | cut -d\" -f2`
    apt update
    #download latest server from here
    wget $MCVersion -P ${CPath}/server 
    sleep 30
    chown minecraft:minecraft ${CPath}/server
    ln -s ${CPath}/server/server.jar ${CPath}/server/${MC_Version}

    printf "Starting MineCraft updated version $MC_Version\n"
    systemctl start minecraft
    eula=`tail -1 ${CPath}/server/eula.txt  | cut -d= -f2`
    if [ "${eula}" == "false" ]
    then 
        printf "accepting EULA\n"
        sleep 10
        systemctl stop minecraft
        sed -i 's/false/TRUE/g' ${CPath}/server/eula.txt
        sleep 10 
        systemctl start minecraft
    fi
    
else
    printf "On Current Version!\n No changes to be Made...\n"
fi
printf "\nExiting\n"

Corry R

(Unassigned)

Unconfirmed

(Unassigned)

1.21.6

Retrieved