2018-06-08 10:34:37 +00:00
|
|
|
#!/usr/local/bin/dumb-init /bin/bash
|
2018-01-06 20:21:57 +00:00
|
|
|
set -euxo pipefail
|
2015-11-22 12:34:49 +00:00
|
|
|
|
|
|
|
if ! [ -e /data/config.ini ]; then
|
2018-06-08 10:34:37 +00:00
|
|
|
cp ${SERVER}/config.ini.default /data/config.ini
|
2015-11-22 12:34:49 +00:00
|
|
|
fi
|
|
|
|
|
2018-01-06 20:21:57 +00:00
|
|
|
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
|
2018-01-06 20:21:57 +00:00
|
|
|
chmod +x "${SERVER_BINARY}"
|
2016-06-23 09:02:43 +00:00
|
|
|
|
2018-06-08 10:34:37 +00:00
|
|
|
# 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 "$@"
|