terraria/start.sh
Knut Ahlers 1c5ee42f5c
Improve image, add command wrapper
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-06-08 12:34:37 +02:00

18 lines
496 B
Bash
Executable file

#!/usr/local/bin/dumb-init /bin/bash
set -euxo pipefail
if ! [ -e /data/config.ini ]; then
cp ${SERVER}/config.ini.default /data/config.ini
fi
SERVER_BINARY=$(find /home/gameserver -name 'TerrariaServer.bin.x86_64')
# FIX: The ZIP archive does not have correct permissions
chmod +x "${SERVER_BINARY}"
# Force data path to be writable
chown -R gameserver:gameserver /data
exec terraria-docker_linux_amd64 | /usr/local/bin/gosu \
gameserver \
${SERVER_BINARY} -config /data/config.ini "$@"