2020-12-28 04:01:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
. ${SCRIPTS:-/}start-utils
|
|
|
|
|
|
|
|
: ${PLUGINS_SYNC_UPDATE:=true}
|
|
|
|
|
|
|
|
isDebugging && set -x
|
|
|
|
|
|
|
|
if [ -d /plugins ]; then
|
|
|
|
case ${TYPE} in
|
|
|
|
SPIGOT|BUKKIT|PAPER|MAGMA)
|
|
|
|
mkdir -p /data/plugins
|
|
|
|
log "Copying plugins over..."
|
|
|
|
if isTrue ${PLUGINS_SYNC_UPDATE}; then
|
|
|
|
updateArg="--update"
|
|
|
|
fi
|
|
|
|
# Copy plugins over using rsync to allow deeply nested updates of plugins
|
|
|
|
rsync -a --out-format="update:%f:Last Modified %M" --prune-empty-dirs $updateArg /plugins /data
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If any modules have been provided, copy them over
|
2021-04-13 01:24:12 +00:00
|
|
|
: ${COPY_MODS_DEST:="/data/mods"}
|
|
|
|
|
2020-12-28 04:01:03 +00:00
|
|
|
if [ -d /mods ]; then
|
|
|
|
log "Copying any mods over..."
|
2021-04-13 01:24:12 +00:00
|
|
|
mkdir -p $COPY_MODS_DEST
|
|
|
|
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /mods/ $COPY_MODS_DEST
|
2020-12-28 04:01:03 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
: ${COPY_CONFIG_DEST:="/data/config"}
|
|
|
|
|
|
|
|
if [ -d /config ]; then
|
|
|
|
log "Copying any configs from /config to $COPY_CONFIG_DEST"
|
|
|
|
mkdir -p $COPY_CONFIG_DEST
|
|
|
|
rsync -a --out-format="update:%f:Last Modified %M" "${rsyncArgs[@]}" --prune-empty-dirs --update /config/ $COPY_CONFIG_DEST
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec ${SCRIPTS:-/}start-finalSetupServerProperties $@
|