mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
Added 'FORCE_WORLD_COPY' environment variable (#580)
This commit is contained in:
parent
cf691499a1
commit
092b530537
@ -947,6 +947,9 @@ read-only volume attachment to ensure the clone source remains pristine.
|
||||
docker run ... -v $HOME/worlds:/worlds:ro -e WORLD=/worlds/basic
|
||||
```
|
||||
|
||||
### Overwrite world on start
|
||||
The world will only be downloaded or copied if it doesn't exist already. Set `FORCE_WORLD_COPY=TRUE` to force overwrite the world on every server start.
|
||||
|
||||
### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
|
||||
|
||||
Like the `WORLD` option above, you can specify the URL of a "mod pack"
|
||||
|
@ -10,7 +10,7 @@ else
|
||||
worldDest=/data/$LEVEL
|
||||
fi
|
||||
|
||||
if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
|
||||
if [[ "$WORLD" ]] && isTrue "${FORCE_WORLD_COPY}" || [ ! -d "$worldDest" ]; then
|
||||
if isURL $WORLD; then
|
||||
curl -fsSL "$WORLD" -o /tmp/world.zip
|
||||
zipSrc=/tmp/world.zip
|
||||
@ -37,10 +37,10 @@ if [[ "$WORLD" ]] && [ ! -d "$worldDest" ]; then
|
||||
log "ERROR invalid world content"
|
||||
exit 1
|
||||
fi
|
||||
mv "$baseDir" "$worldDest"
|
||||
rsync --remove-source-files --recursive --delete "$baseDir/" "$worldDest"
|
||||
else
|
||||
log "Cloning world directory from $WORLD ..."
|
||||
cp -r "$WORLD" "$worldDest"
|
||||
rsync --recursive --delete "${WORLD%/}"/ "$worldDest"
|
||||
fi
|
||||
|
||||
if [ "$TYPE" = "SPIGOT" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user