Ahtenus / minecraft-init

Init script for minecraft and bukkit servers
404 stars 125 forks source link

Update broken (solved by myself, patch your script now) #186

Closed derdickepozilist closed 7 years ago

derdickepozilist commented 7 years ago

I cannot update my server any more - i think they changed the addresses for the server-download, because the script tells

Checking for update for minecraft_server.jar (Vanilla)
wget: URL missing (translated from german)

so it must be line 427 failing to get a download link from the website:

MC_SERVER_URL=`wget -q -O - http://minecraft.net/download | grep minecraft_server.jar\ | cut -d \" -f 6\`

Since I am already here and you may be reading it with the same issue, I did a solution for this instead of complaining about it!

let's see:

wget -q -O - http://minecraft.net/download //download the html-pages' content to stdout
grep minecraft_server.jar\ //grep the server.jar line
cut -d\" -f 6 //cut it out of its ""s

they moved the server download to its own page, and multilanguaged the page:

https://minecraft.net/en-us/download/server

download-links now look like this:

https://s3.amazonaws.com/Minecraft.Download/versions/1.12/minecraft_server.1.12.jar

so the script may change to this:

wget -q -O - https://minecraft.net/en-us/download/server //get the new download-pages' content to stdout
grep Minecraft.Download\ //no-brainer, find the most distinguishable part of the URL to locate line with Download-Path, this will follow new versions!
cut -d\" -f 2 //cut out the part between the "" of the html; actually tried the value for "f" out, since "6" was no good any more

so the whole line 427 may change to this:

MC_SERVER_URL=`wget -q -O - https://minecraft.net/en-us/download/server | grep Minecraft.Download | cut -d\" -f 2`

Tested and working as of 2017-06-08!

derdickepozilist commented 7 years ago

Did it already myself, so i will close this issue!

erkston commented 6 years ago

they changed the download URL again, using this as my line 427 seems to work for now

MC_SERVER_URL=`wget` -q -O - https://minecraft.net/en-us/download/server | grep "launcher.mojang.com/mc/game/" | cut -d\" -f 2`