mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-05 01:49:16 +00:00
parent
fda8981028
commit
4ff158266a
3 changed files with 8 additions and 7 deletions
|
@ -9,7 +9,7 @@ handleDebugMode
|
|||
: "${SPIGET_RESOURCES:=}"
|
||||
: "${SPIGET_DOWNLOAD_TOLERANCE:=5}" # in minutes
|
||||
|
||||
acceptArgs=(--accept application/zip --accept application/java-archive)
|
||||
acceptArgs=(--accept application/zip --accept application/java-archive --accept application/octet-stream)
|
||||
|
||||
containsJars() {
|
||||
file=${1?}
|
||||
|
@ -20,7 +20,7 @@ containsJars() {
|
|||
if [[ $line =~ $pat ]]; then
|
||||
return 0
|
||||
fi
|
||||
done < <(unzip -l "$file")
|
||||
done < <(unzip -l "$file" | tail -n +4)
|
||||
|
||||
return 1
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ containsPlugin() {
|
|||
if [[ $line =~ $pat ]]; then
|
||||
return 0
|
||||
fi
|
||||
done < <(unzip -l "$file")
|
||||
done < <(unzip -l "$file" | tail -n +4)
|
||||
|
||||
return 1
|
||||
}
|
||||
|
@ -101,11 +101,11 @@ downloadResourceFromSpiget() {
|
|||
log "ERROR: failed to retrieve file type of resource $resource"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $fileType == .zip ]]; then
|
||||
if containsJars "${outfile}"; then
|
||||
log "Extracting contents of resource ${resource} into plugins"
|
||||
extract "$outfile" /data/plugins
|
||||
rm "$outfile"
|
||||
elif [[ $fileType == .jar ]]; then
|
||||
elif containsPlugin "${outfile}"; then
|
||||
log "Moving resource ${resource} into plugins"
|
||||
mv "$outfile" /data/plugins
|
||||
else
|
||||
|
|
|
@ -8,6 +8,6 @@ services:
|
|||
EULA: "TRUE"
|
||||
SETUP_ONLY: "TRUE"
|
||||
TYPE: PAPER
|
||||
SPIGET_RESOURCES: "34315,3836,6245"
|
||||
SPIGET_RESOURCES: "34315,3836,6245,2124"
|
||||
volumes:
|
||||
- ./data:/data
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
mc-image-helper assert fileExists plugins/3836.jar
|
||||
mc-image-helper assert fileExists plugins/34315.jar
|
||||
mc-image-helper assert fileExists plugins/6245.jar
|
||||
mc-image-helper assert fileExists plugins/6245.jar
|
||||
mc-image-helper assert fileExists plugins/SkinsRestorer.jar
|
Loading…
Reference in a new issue