mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-04-07 22:28:52 +00:00
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user