Skip to content

Instantly share code, notes, and snippets.

@bastos71
Created October 19, 2025 11:46
Show Gist options
  • Select an option

  • Save bastos71/7e97c844e944e2b5aeb3b8b1a2080fb1 to your computer and use it in GitHub Desktop.

Select an option

Save bastos71/7e97c844e944e2b5aeb3b8b1a2080fb1 to your computer and use it in GitHub Desktop.
Minecraft server auto update script
#!/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
@bastos71
Copy link
Author

bastos71 commented Oct 19, 2025

This shell script :

  • save your server diffs by commiting it to the git repo
  • get the last version link and version number
  • pull the new version archive
  • unzip the archive in the current directory
  • delete the archive
  • outputs success message with details

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 ๐Ÿ™‚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment