Created
October 19, 2025 11:46
-
-
Save bastos71/7e97c844e944e2b5aeb3b8b1a2080fb1 to your computer and use it in GitHub Desktop.
Minecraft server auto update script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| printf '\033[8;40;200t' | |
| echo "============" | |
| echo "Saving server files before update..." | |
| git add . | |
| git commit -m "Incremental save before update" --allow-empty | |
| echo "Done !" | |
| echo "" | |
| echo "Retrieving last version info..." | |
| minecraftserverlink=$(curl "https://net-secondary.web.minecraft-services.net/api/v1.0/download/links" -A "Mozilla" | grep -Po '(https:\/\/.*bin-win\/.*?.zip)') | |
| minecraftserverversion=$(echo $minecraftserverlink | grep -Po 'bedrock-server-\K(.*)(?=.zip)') | |
| echo "Done !" | |
| echo "" | |
| echo "============" | |
| echo "Getting server archive version $minecraftserverversion located to $minecraftserverlink..." | |
| curl $minecraftserverlink -L -o "./minecraft-server-bedrock.zip" -A "Mozilla" | |
| echo "Done !" | |
| echo "" | |
| echo "============" | |
| echo "Unzipping archive..." | |
| unzip -oq "./minecraft-server-bedrock.zip" | |
| echo "Done !" | |
| echo "" | |
| echo "============" | |
| echo "Deleting archive..." | |
| rm "./minecraft-server-bedrock.zip" | |
| echo "Done !" | |
| echo "" | |
| git add . | |
| echo "###############################################################################################################################################################" | |
| echo '$$\ $$\ $$\ $$\ $$$$$$\ $$\ ' | |
| echo '$$ | $$ | $$ | $$ | $$ __$$\ $$ |' | |
| echo '$$ | $$ | $$$$$$\ $$$$$$$ | $$$$$$\ $$$$$$\ $$$$$$\ $$$$$$$\ $$\ $$\ $$$$$$$\ $$$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$$\ $$ / \__|$$\ $$\ $$ |' | |
| echo '$$ | $$ |$$ __$$\ $$ __$$ | \____$$\\_$$ _| $$ __$$\ $$ _____|$$ | $$ |$$ _____|$$ _____|$$ __$$\ $$ _____|$$ _____|$$$$\ $$ | $$ |$$ |' | |
| echo '$$ | $$ |$$ / $$ |$$ / $$ | $$$$$$$ | $$ | $$$$$$$$ | \$$$$$$\ $$ | $$ |$$ / $$ / $$$$$$$$ |\$$$$$$\ \$$$$$$\ $$ _| $$ | $$ |$$ |' | |
| echo '$$ | $$ |$$ | $$ |$$ | $$ |$$ __$$ | $$ |$$\ $$ ____| \____$$\ $$ | $$ |$$ | $$ | $$ ____| \____$$\ \____$$\ $$ | $$ | $$ |$$ |' | |
| echo '\$$$$$$ |$$$$$$$ |\$$$$$$$ |\$$$$$$$ | \$$$$ |\$$$$$$$\ $$$$$$$ |\$$$$$$ |\$$$$$$$\ \$$$$$$$\ \$$$$$$$\ $$$$$$$ |$$$$$$$ |$$ | \$$$$$$ |$$ |' | |
| echo ' \______/ $$ ____/ \_______| \_______| \____/ \_______| \_______/ \______/ \_______| \_______| \_______|\_______/ \_______/ \__| \______/ \__|' | |
| echo ' $$ | ' | |
| echo ' $$ | ' | |
| echo ' \__| ' | |
| echo "###############################################################################################################################################################" | |
| echo "" | |
| echo "Please check the following files before committing :" | |
| echo "- ./bedrock_server_how_to.html" | |
| echo "- ./persmissions.json" | |
| echo "- ./server.properties" | |
| echo "" | |
| echo "Commit message : " | |
| echo "Upgrade to version $minecraftserverversion" | |
| echo "" | |
| echo "" | |
| echo "###############################################################################################################################################################" | |
| $SHELL |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This shell script :
After that, just check the changed files before committing, and you're all done ๐
Note : if you're not running windows bedrock server, you can update the script to your needs ๐