Skip to content

Commit

Permalink
Add paper download script.
Browse files Browse the repository at this point in the history
  • Loading branch information
seyfahni committed Jul 17, 2020
1 parent aeb0eeb commit 8671762
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions paper-download.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

if [[ $# -eq 0 ]]; then
version="$(wget -q -O - https://papermc.io/api/v1/paper | jq -r '.versions[]' | sort -Vr | head -n1)"
else
version="$1"
fi
if [[ $# -eq 1 ]]; then
build="$(wget -q -O - https://papermc.io/api/v1/paper/"$version" | jq -r '.builds.latest')"
else
build="$2"
fi
if [[ $# -gt 2 ]]; then
exit 1
fi

echo "loading server binary for minecraft version $version build $build"

wget -q -O "paper-$version-$build.jar" "https://papermc.io/api/v1/paper/$version/$build/download"

0 comments on commit 8671762

Please sign in to comment.