62 lines
1.0 KiB
Bash
Executable File
62 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
meta_dir="docker_meta"
|
|
|
|
if test ! -f "$meta_dir/config_done"; then
|
|
if test "$PAPER_NEW_CONFIG" != "true"; then
|
|
config_path="paper.yml"
|
|
else
|
|
mkdir "config"
|
|
config_path="config/paper-global.yml"
|
|
fi
|
|
|
|
config=""
|
|
|
|
if test "$VELOCITY_ENABLE" = "true"; then
|
|
echo "online-mode=false" > server.properties
|
|
|
|
if test "$PAPER_NEW_CONFIG" != "true"; then
|
|
velocity=$(cat << EOF
|
|
settings:
|
|
velocity-support:
|
|
enabled: true
|
|
online-mode: true
|
|
secret: '$VELOCITY_SECRET'
|
|
EOF
|
|
)
|
|
else
|
|
velocity=$(cat << EOF
|
|
proxies:
|
|
velocity:
|
|
enabled: true
|
|
online-mode: true
|
|
secret: '$VELOCITY_SECRET'
|
|
EOF
|
|
)
|
|
fi
|
|
|
|
|
|
config="${config}${velocity}"
|
|
fi
|
|
|
|
if test ! -z "$config"; then
|
|
echo "Writing config to $config_path"
|
|
echo "$config" > $config_path
|
|
fi
|
|
|
|
echo "eula=true" > eula.txt
|
|
|
|
mkdir -p "$meta_dir" && touch "$meta_dir/config_done"
|
|
else
|
|
echo "Configuration is done"
|
|
fi
|
|
|
|
if test ! -f "paper.jar" -o "$PAPER_UPDATE_ON_START" == "true"; then
|
|
update_paper
|
|
else
|
|
echo "Skipping Paper download"
|
|
fi
|
|
|
|
echo "> $@"
|
|
exec "$@"
|