Created
November 25, 2020 14:03
-
-
Save indrer/0f4ed1359e90e2be8517d0aff9dfb5d1 to your computer and use it in GitHub Desktop.
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 | |
jqpkg='jq' | |
if ! dpkg -s $jqpkg >/dev/null 2>&1; then | |
sudo apt install $jqpkg | |
fi | |
echo "Collecting information about the latest PaperMC version.." | |
group_version=$( curl -s -X GET "https://papermc.io/api/v2/projects/paper" | jq -r '.version_groups | last' ) | |
latest_version=$( curl -s -X GET "https://papermc.io/api/v2/projects/paper/version_group/${group_version}" | jq -r '.versions | last' ) | |
latest_build=$( curl -s -X GET "https://papermc.io/api/v2/projects/paper/versions/${latest_version}" | jq -r '.builds | last' ) | |
echo "Downloading version $latest_version build $latest_build" | |
curl -o paper.jar "https://papermc.io/api/v2/projects/paper/versions/${latest_version}/builds/${latest_build}/downloads/paper-${latest_version}-${latest_build}.jar" | |
echo "Download complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment