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
|
|
|
|
|
2018-06-12 17:37:03 +00:00
|
|
|
# Cleanup fifo if already exists
|
|
|
|
[ -e /home/gameserver/terraria_cmd ] && rm -f /home/gameserver/terraria_cmd
|
|
|
|
|
2018-07-06 16:24:31 +00:00
|
|
|
exec /usr/local/bin/gosu gameserver terraria-docker -- \
|
2018-06-08 10:34:37 +00:00
|
|
|
${SERVER_BINARY} -config /data/config.ini "$@"
|