mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
parent
b5e459ab0a
commit
5617936f10
@ -24,6 +24,8 @@ RUN useradd -M -s /bin/false --uid 1000 minecraft \
|
||||
EXPOSE 25565
|
||||
EXPOSE 25575
|
||||
|
||||
COPY get-mcadmin-versions.sh /get-mcadmin-versions
|
||||
RUN /get-mcadmin-versions https://mcadmin.net/
|
||||
COPY start.sh /start
|
||||
COPY start-minecraft.sh /start-minecraft
|
||||
|
||||
|
13
minecraft-server/get-mcadmin-versions.sh
Executable file
13
minecraft-server/get-mcadmin-versions.sh
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo Missing arg: URL
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd /tmp
|
||||
wget -O mcadmin-versions.jar https://bintray.com/itzgeoff/artifacts/download_file?file_path=me%2Fitzg%2Fmcadmin-versions%2F1.1.0%2Fmcadmin-versions-1.1.0.jar
|
||||
wget http://central.maven.org/maven2/org/jsoup/jsoup/1.9.1/jsoup-1.9.1.jar
|
||||
|
||||
java -jar mcadmin-versions.jar $1 > /tmp/mcadmin-versions.db
|
||||
rm *.jar
|
@ -50,22 +50,18 @@ function buildSpigotFromSource {
|
||||
}
|
||||
|
||||
function downloadSpigot {
|
||||
local match
|
||||
case "$TYPE" in
|
||||
*BUKKIT|*bukkit)
|
||||
match="Craftbukkit $VANILLA_VERSION"
|
||||
match="Craftbukkit"
|
||||
|
||||
;;
|
||||
*)
|
||||
match="Spigot $VANILLA_VERSION"
|
||||
match="Spigot"
|
||||
;;
|
||||
esac
|
||||
|
||||
curl -o /tmp/versions -sSL https://getspigot.org/api/getversions
|
||||
status=$?
|
||||
if [ $status != 0 ]; then
|
||||
echo "ERROR: failed to access Spigot versions (curl error code was $status)"
|
||||
exit 3
|
||||
fi
|
||||
downloadUrl=$(cat /tmp/versions | jq -r ".[] | select(.version == \"$match\") | .downloadUrl")
|
||||
downloadUrl=$(awk -F:: "\$1 == \"${match}\" && \$2 == \"${VANILLA_VERSION}\" {print \$3}" /tmp/mcadmin-versions.db)
|
||||
if [[ -n $downloadUrl ]]; then
|
||||
echo "Downloading $match"
|
||||
wget -q -O $SERVER "$downloadUrl"
|
||||
|
Loading…
Reference in New Issue
Block a user