docker-minecraft/fsRoot/opt/minecraft/downloadServer.sh
jreichmann 22bb490237 Add Dockerfile and rough container file structure
Added Dockerfile based on alpine:edge with the following packages:

- curl - for downloading the server & querying for versions
- jq - parsing JSON from bash

Set up internal file structure of the container with scripts to download and run the server (unfinished)
2018-03-03 10:36:20 +01:00

20 lines
524 B
Bash

#!/bin/bash
BASE_DOWNLOAD_URL="https://s3.amazonaws.com/Minecraft.Download/versions/"
VERSION_INFO_URL="https://launchermeta.mojang.com/mc/game/version_manifast.json"
function query_latest_release() {
curl -s "$VERSION_INFO_URL" | jq -r '.latest.release'
}
function query_latest_snapshot() {
curl -s "$VERSION_INFO_URL" | jq -r '.latest.snapshot'
}
function download_version() {
local version="$1"
local url="${BASE_DOWNLOAD_URL}${version}/minecraft_server.${version}.jar"
curl -s -o "minecraft_server.jar" $url
}