mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-09-04 13:15:04 +00:00
feat(minecraft-server): copy mods with rsync as well
Mods are now copied the same as plugins, with rsync. Removed the old cp command.
This commit is contained in:
@@ -36,13 +36,11 @@ done
|
|||||||
|
|
||||||
# If any modules have been provided, copy them over
|
# If any modules have been provided, copy them over
|
||||||
mkdir -p /data/mods
|
mkdir -p /data/mods
|
||||||
for m in /mods/*.{jar,zip}
|
if [ -d /mods ]; then
|
||||||
do
|
echo "Copying any mods over..."
|
||||||
if [ -f "$m" -a ! -f "/data/mods/$m" ]; then
|
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --include '*/' --include '*.jar' -include '*.zip' --exclude '*' --update /mods /data/mods
|
||||||
echo Copying mod `basename "$m"`
|
fi
|
||||||
cp "$m" /data/mods
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
[ -d /data/config ] || mkdir /data/config
|
[ -d /data/config ] || mkdir /data/config
|
||||||
for c in /config/*
|
for c in /config/*
|
||||||
do
|
do
|
||||||
@@ -52,11 +50,10 @@ do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
mkdir -p /data/plugins
|
||||||
if [ "$TYPE" = "SPIGOT" ]; then
|
if [ "$TYPE" = "SPIGOT" ]; then
|
||||||
if [ -d /plugins ]; then
|
if [ -d /plugins ]; then
|
||||||
# Copy all of the plugins directory first to include initial configs
|
echo "Copying any Bukkit plugins over..."
|
||||||
echo Copying any Bukkit plugins over
|
|
||||||
cp -r /plugins /data
|
|
||||||
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
||||||
# only updates files if the source file is newer and print updated files
|
# only updates files if the source file is newer and print updated files
|
||||||
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --include '*/' --include '*.jar' --exclude '*' --update /plugins /data/plugins
|
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs --include '*/' --include '*.jar' --exclude '*' --update /plugins /data/plugins
|
||||||
|
|||||||
Reference in New Issue
Block a user