Giter VIP home page Giter VIP logo

mcupdater's Introduction

McUpdater

Update your minecraft server (Automated)

This script was made to make updating minecraft servers easier and a lot more efficient (in my opinion)

The only thing you need to do once the script is downloaded and running in a cron schedule is just update a file in the minecraft server and it will automatically do the rest for you.

Dependancies

All of these are required.

Not required

  • mcrcon -- Highly reconmended, telneting into the Remote Tool Kit in a script is ineficient.

How does it work?

Rebooting works because Multicraft thinks the game has crashed when you run /stop from rcon while you have the Tool Kit wrapper I'm not sure why, but without that then this script does not work.

What we do is upload alternating names of the server.jar, and replace that name inside of the Remote Tool Kit's config to point to that one then reboot the server and it will switch right over.

How do I automate this?

To automate updates, run the Latest or Released jar script of your choice (Read Bonus) a couple minutes before running McUpdate.sh For example, I have LatestMC_JAR.sh running 2 minutes before McUpdate.sh, and have McUpdate.sh run once every 10 minutes or so via crontab.

Bonus

LatestMC_JAR.sh will grab the download link for the latest server.jar, you can choose to download the jar file or have it save the url to the txt file that McUpdate.sh looks for when it checks for updates.

ReleasedMC_JAR.sh will grab the download link for the latest Full-Release version of server.jar, you can choose to download the jar file or save the url to the txt file that McUpdate.sh looks for when it checks for updates.

Notes

  • if running on a Raspberry Pi you have to compile mcrcon!
  • LatestMC_JAR.sh will download ANY latest server.jar, INCLUDING Snapshtos and Pre-releases!
  • Automation depends on your setup, You'll need to use one of the LatestMC/ReleasedMC scripts along side this script for now.

To-do

  • Add pre-update RCON command, along with a kick all command (/kick @a), and with a user-defined delay before updating
  • Add feature to enable/disable HTTP Request once server is updated (Bonus of this; Can link to discord!)
  • Ability to grab the latest full-release of server.jar -- Done, see Bonus in README
  • Incorperate both update grabbing scripts into McUpdate.sh (Bonus; having the option to check for updates using a file in ftp OR from mojang's json manifest file directly)
  • Eventually just use lftp for uploading/downloading
  • Add a timeout for the while loop so that the server doesn't keep getting pinged.
  • Hopefully add a workaround to restart the server via Telnet as a sepearate executeed script for minecraft versions 18w48a+ -- No Longer Needed. Mojang corrected the bug.
  • Create a version of this updater for servers that do not use Minecraft Remote toolkit, as the concept should be the same only I hadn't put any thought to it.

Known problems

  • 18w47a until 19w04b the server will hang at saving the worlds and does not fully shutdown, this causes Remote toolkit to never know if the server really stopped or not. If you plan on using these versions with this script, it will be partially broken and will need to .forcestopwrapper See here

Disclaimer(s)

  • For the entirety of stopwrapper.sh: I do not take ownership or claim credit to the creation of the telnet automation. Usually I make it clear what portions of scripts or commands I used from other people, but in this case I begun using the script before I made the habbit to note down the sources. So the source of where I got that script from is lost.

mcupdater's People

Contributors

jakesta13 avatar

Stargazers

Tominous avatar

Watchers

Tominous avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.