terraria/start.sh

21 lines
592 B
Bash
Raw Normal View History

#!/usr/local/bin/dumb-init /bin/bash
set -euxo pipefail
2015-11-22 12:34:49 +00:00
if ! [ -e /data/config.ini ]; then
cp ${SERVER}/config.ini.default /data/config.ini
2015-11-22 12:34:49 +00:00
fi
SERVER_BINARY=$(find /home/gameserver -name 'TerrariaServer.bin.x86_64')
2016-06-23 09:02:43 +00:00
# FIX: The ZIP archive does not have correct permissions
chmod +x "${SERVER_BINARY}"
2016-06-23 09:02:43 +00:00
# Force data path to be writable
chown -R gameserver:gameserver /data
# Cleanup fifo if already exists
[ -e /home/gameserver/terraria_cmd ] && rm -f /home/gameserver/terraria_cmd
exec /usr/local/bin/gosu gameserver terraria-docker -- \
${SERVER_BINARY} -config /data/config.ini "$@"