exporting environment variables

This commit is contained in:
Hendrik Boll 2019-09-28 11:49:02 +02:00
parent 3ca1aa59ab
commit 5307b4a83d
1 changed files with 16 additions and 16 deletions

View File

@ -24,83 +24,83 @@ if [[ -z "${SERVER_LOGIN_PASSWORD}" ]]; then
fi
if [[ -z "${SERVER_PORT}" ]]; then
echo "No server port was set. Defaulting to port 2350"
SERVER_PORT="2350"
export SERVER_PORT="2350"
fi
if [[ -z "${SERVER_P2P_PORT}" ]]; then
echo "No server peer2peer port was set. Defaulting to port 3450"
SERVER_P2P_PORT="3450"
export SERVER_P2P_PORT="3450"
fi
if [[ -z "${SERVER_SA_PASSWORD}" ]]; then
echo "No SuperAdmin password was set. Generating a random one. You can change it afterwards but it's also not that important"
echo "Might aswell leave it as randomly generated"
SERVER_SA_PASSWORD=$(pwgen -s 12)
export SERVER_SA_PASSWORD=$(pwgen -s 12)
echo "SuperAdmin password: ${SERVER_SA_PASSWORD}"
echo "Please write this down or pipe the docker logs to a file."
fi
if [[ -z "${SERVER_ADM_PASSWORD}" ]]; then
echo "No Admin password was set. Generating a random one. You can change it afterwards but it's also not that important"
echo "Might aswell leave it as randomly generated"
SERVER_ADM_PASSWORD=$(pwgen -s 12)
export SERVER_ADM_PASSWORD=$(pwgen -s 12)
echo "Admin password: ${SERVER_ADM_PASSWORD}"
echo "Please write this down or pipe the docker logs to a file."
fi
if [[ -z "${SERVER_NAME}" ]]; then
echo "No server name was set. Defaulting to 'Trackmania Server'"
SERVER_NAME="Trackmania Server"
export SERVER_NAME="Trackmania Server"
fi
if [[ -z "${SERVER_COMMENT}" ]]; then
echo "No server description was set. Defaulting to 'This is a Trackmania Server'"
SERVER_COMMENT="This is a Trackmania Server"
export SERVER_COMMENT="This is a Trackmania Server"
fi
if [[ -z "${GAMEMODE}" ]]; then
echo "No gamemode was specified. Defaulting to TimeAttack."
GAMEMODE="1"
export GAMEMODE="1"
fi
if [[ -z "${CHATTIME}" ]]; then
echo "No chat timeout was specified. Defaulting to 10000 ms."
CHATTIME="10000"
export CHATTIME="10000"
fi
if [[ -z "${FINISHTIMEOUT}" ]]; then
echo "No finish timeout was specified. Defaulting to adaptive mode."
FINISHTIMEOUT="1"
export FINISHTIMEOUT="1"
fi
if [[ -z "${DISABLERESPAWN}" ]]; then
echo "Respawns were not specified. Defaulting to enabled."
DISABLERESPAWN="0"
export DISABLERESPAWN="0"
fi
if [[ -z "${ROUNDS_POINTSLIMIT}" ]]; then
echo "No points limit was specified for rounds mode. Defaulting to 30."
ROUNDS_POINTSLIMIT="30"
export ROUNDS_POINTSLIMIT="30"
fi
if [[ -z "${TIMEATTACK_LIMIT}" ]]; then
echo "No time limit was specified for time attack mode. Defaulting to 180000 ms."
TIMEATTACK_LIMIT="180000"
export TIMEATTACK_LIMIT="180000"
fi
if [[ -z "${TEAM_POINTSLIMIT}" ]]; then
echo "No points limit was specified for team mode. Defaulting to 50."
TEAM_POINTSLIMIT="50"
export TEAM_POINTSLIMIT="50"
fi
if [[ -z "${TEAM_MAXPOINTS}" ]]; then
echo "No number of maximum points per round was specified for team mode. Defaulting to 6."
TEAM_MAXPOINTS="6"
export TEAM_MAXPOINTS="6"
fi
if [[ -z "${LAPS_NBLAPS}" ]]; then
echo "No number of laps was specified for laps mode. Defaulting to 5."
LAPS_NBLAPS="5"
export LAPS_NBLAPS="5"
fi
if [[ -z "${LAPS_TIMELIMIT}" ]]; then
echo "No time limit was specified for laps mode. Defaulting to no limit."
LAPS_TIMELIMIT="0"
export LAPS_TIMELIMIT="0"
fi