fixed syntax errors in entrypoint

This commit is contained in:
ryluth 2019-09-27 10:55:08 +02:00 committed by GitHub
parent 82679ffa2e
commit 931fd0d989
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 16 deletions

View File

@ -3,7 +3,7 @@
set -e set -e
if [[ "$(id -u)" = "0"]]; then if [[ "$(id -u)" = "0" ]]; then
chown -R trackmania /opt/tmserver chown -R trackmania /opt/tmserver
exec su-exec trackmania "$0" exec su-exec trackmania "$0"
fi fi
@ -46,52 +46,52 @@ if [[ -z "${SERVER_COMMENT}" ]]; then
SERVER_COMMENT="This is a Trackmania Server" SERVER_COMMENT="This is a Trackmania Server"
fi fi
if [[ -z "${GAMEMODE}"]]; then if [[ -z "${GAMEMODE}" ]]; then
echo "No gamemode was specified. Defaulting to TimeAttack." echo "No gamemode was specified. Defaulting to TimeAttack."
GAMEMODE=1 GAMEMODE=1
fi fi
if [[ -z "${CHATTIME}"]]; then if [[ -z "${CHATTIME}" ]]; then
echo "No chat timeout was specified. Defaulting to 10000 ms." echo "No chat timeout was specified. Defaulting to 10000 ms."
CHATTIME=10000 CHATTIME=10000
fi fi
if [[ -z "${FINISHTIMEOUT}"]]; then if [[ -z "${FINISHTIMEOUT}" ]]; then
echo "No finish timeout was specified. Defaulting to adaptive mode." echo "No finish timeout was specified. Defaulting to adaptive mode."
FINISHTIMEOUT=1 FINISHTIMEOUT=1
fi fi
if [[ -z "${DISABLERESPAWN}"]]; then if [[ -z "${DISABLERESPAWN}" ]]; then
echo "Respawns were not specified. Defaulting to enabled." echo "Respawns were not specified. Defaulting to enabled."
DISABLERESPAWN=0 DISABLERESPAWN=0
fi fi
if [[ -z "${ROUNDS_POINTSLIMIT}"]]; then if [[ -z "${ROUNDS_POINTSLIMIT}" ]]; then
echo "No points limit was specified for rounds mode. Defaulting to 30." echo "No points limit was specified for rounds mode. Defaulting to 30."
ROUNDS_POINTSLIMIT=30 ROUNDS_POINTSLIMIT=30
fi fi
if [[ -z "${TIMEATTACK_LIMIT}"]]; then if [[ -z "${TIMEATTACK_LIMIT}" ]]; then
echo "No time limit was specified for time attack mode. Defaulting to 180000 ms." echo "No time limit was specified for time attack mode. Defaulting to 180000 ms."
TIMEATTACK_LIMIT=180000 TIMEATTACK_LIMIT=180000
fi fi
if [[ -z "${TEAM_POINTSLIMIT}"]]; then if [[ -z "${TEAM_POINTSLIMIT}" ]]; then
echo "No points limit was specified for team mode. Defaulting to 50." echo "No points limit was specified for team mode. Defaulting to 50."
TEAM_POINTSLIMIT=50 TEAM_POINTSLIMIT=50
fi fi
if [[ -z "${TEAM_MAXPOINTS}"]]; then if [[ -z "${TEAM_MAXPOINTS}" ]]; then
echo "No number of maximum points per round was specified for team mode. Defaulting to 6." echo "No number of maximum points per round was specified for team mode. Defaulting to 6."
TEAM_MAXPOINTS=6 TEAM_MAXPOINTS=6
fi fi
if [[ -z "${LAPS_NBLAPS}"]]; then if [[ -z "${LAPS_NBLAPS}" ]]; then
echo "No number of laps was specified for laps mode. Defaulting to 5." echo "No number of laps was specified for laps mode. Defaulting to 5."
LAPS_NBLAPS=5 LAPS_NBLAPS=5
fi fi
if [[ -z "${LAPS_TIMELIMIT}"]]; then if [[ -z "${LAPS_TIMELIMIT}" ]]; then
echo "No time limit was specified for laps mode. Defaulting to no limit." echo "No time limit was specified for laps mode. Defaulting to no limit."
LAPS_TIMELIMIT=0 LAPS_TIMELIMIT=0
fi fi
@ -102,10 +102,7 @@ echo "Substition in config files"
#Trackmania Files #Trackmania Files
$configcmd="envsubst > GameData/Config/config.txt < GameData/Config/_config.txt" envsubst > GameData/Config/config.txt < GameData/Config/_config.txt
$playlistcmd="envsubst > GameData/Config/playlist.txt < GameData/Config/_playlist.txt" envsubst > GameData/Config/playlist.txt < GameData/Config/_playlist.txt
eval $configcmd
eval $playlistcmd
exec "/opt/tmserver/TrackmaniaServer" "/nodaemon" "/internet" "/game_settings=MatchSettings/playlist.txt" "/dedicated_cfg=config.txt" exec "/opt/tmserver/TrackmaniaServer" "/nodaemon" "/internet" "/game_settings=MatchSettings/playlist.txt" "/dedicated_cfg=config.txt"