mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-14 12:34:54 +00:00
Auto-merging via docker-versions-create
This commit is contained in:
+20
-13
@@ -26,21 +26,28 @@ getResourceFromSpiget() {
|
|||||||
|
|
||||||
log "Downloading resource ${resource} ..."
|
log "Downloading resource ${resource} ..."
|
||||||
|
|
||||||
tmpfile="/tmp/${resource}.zip"
|
|
||||||
url="https://api.spiget.org/v2/resources/${resource}/download"
|
|
||||||
if ! curl -o "${tmpfile}" -fsSL -H "User-Agent: itzg/minecraft-server" "${extraCurlArgs[@]}" "${url}"; then
|
|
||||||
log "ERROR failed to download resource '${resource}' from ${url}"
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p /data/plugins
|
mkdir -p /data/plugins
|
||||||
if containsJars "${tmpfile}"; then
|
|
||||||
log "Extracting contents of resource ${resource} into plugins"
|
if [ -f /data/plugins/.${resource} ]; then
|
||||||
unzip -o -q -d /data/plugins "${tmpfile}"
|
log "Resource '${$resource}' already downloaded"
|
||||||
rm "${tmpfile}"
|
|
||||||
else
|
else
|
||||||
log "Moving resource ${resource} into plugins"
|
tmpfile="/tmp/${resource}.zip"
|
||||||
mv "${tmpfile}" "/data/plugins/${resource}.jar"
|
url="https://api.spiget.org/v2/resources/${resource}/download"
|
||||||
|
if ! curl -o "${tmpfile}" -fsSL -H "User-Agent: itzg/minecraft-server" "${extraCurlArgs[@]}" "${url}"; then
|
||||||
|
log "ERROR failed to download resource '${resource}' from ${url}"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if containsJars "${tmpfile}"; then
|
||||||
|
log "Extracting contents of resource ${resource} into plugins"
|
||||||
|
unzip -o -q -d /data/plugins "${tmpfile}"
|
||||||
|
touch "/data/plugins/.${resource}"
|
||||||
|
rm "${tmpfile}"
|
||||||
|
else
|
||||||
|
log "Moving resource ${resource} into plugins"
|
||||||
|
mv "${tmpfile}" "/data/plugins/${resource}.jar"
|
||||||
|
touch "/data/plugins/.${resource}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user