Skip to content

Commit

Permalink
Skipped bungeecord config.yml when not present
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg committed Nov 21, 2021
1 parent 8faaf6e commit 1aacb7f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
2 changes: 1 addition & 1 deletion docs/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ services:
environment:
BUNGEE_JAR_REVISION: "1"
ports:
- 25565:25577
- "25565:25577"
volumes:
- ./config.yml:/config/config.yml
41 changes: 16 additions & 25 deletions run-bungeecord.sh
Original file line number Diff line number Diff line change
Expand Up @@ -260,33 +260,24 @@ else # Download orblazer/bungee-rcon plugin
fi

if [ -d /config ]; then
log "Copying BungeeCord configs over..."
cp -u /config/config.yml "$BUNGEE_HOME/config.yml"

# Copy other files if avaliable
# server icon
if [ -f /config/server-icon.png ]; then
cp -u /config/server-icon.png "$BUNGEE_HOME/server-icon.png"
fi
# custom module list
if [ -f /config/modules.yml ]; then
cp -u /config/modules.yml "$BUNGEE_HOME/modules.yml"
fi
# Waterfall config
if [ -f /config/waterfall.yml ]; then
cp -u /config/waterfall.yml "$BUNGEE_HOME/waterfall.yml"
fi
# Velocity config
if [ -f /config/velocity.toml ]; then
cp -u /config/velocity.toml "$BUNGEE_HOME/velocity.toml"
fi
# Messages
if [ -f /config/messages.properties ]; then
cp -u /config/messages.properties "$BUNGEE_HOME/messages.properties"
fi
log "Copying configs over..."

files=(
config.yml
server-icon.png
modules.yml
waterfall.yml
velocity.toml
messages.properties
)
for f in "${files[@]}"; do
if [ -f "/config/$f" ]; then
cp -u "/config/$f" "$BUNGEE_HOME/$f"
fi
done
fi

if [ -f /var/run/default-config.yml -a ! -f $BUNGEE_HOME/config.yml ]; then
if [ -f /var/run/default-config.yml ] && [ ! -f $BUNGEE_HOME/config.yml ]; then
log "Installing default configuration"
cp /var/run/default-config.yml $BUNGEE_HOME/config.yml
if [ $UID == 0 ]; then
Expand Down

0 comments on commit 1aacb7f

Please sign in to comment.