Files
Robert Adams bcd31f7289 Add 'opensim-standalone' version with runtime configurations
for a SQLite standalone version and a MariaDB version (docker-compose
of two containers).
2019-10-05 18:36:35 -07:00

33 lines
917 B
Bash
Executable File

#! /bin/bash
# Script run when the container starts and before OpenSimulator is started
OPENSIMBIN=${OPENSIMBIN:-/home/opensim/opensim/bin}
CONFIGDIR=${CONFIGDIR:-$OPENSIMBIN/config}
FIRSTTIMEFLAG=${CONFIGDIR}/.configFirstTime
cd "$CONFIGDIR"
# This sets CONFIG_NAME which is the configuration subdirectory (like standalone)
source ./scripts/setEnvironment.sh
if [[ ! -e "$FIRSTTIMEFLAG" ]] ; then
cd "$CONFIGDIR"
# Do any database account and db creation
./scripts/initializeDb.sh
# Add environment variables to configuration files
./scripts/initializeConfig.sh
# Remember we've done this
touch "$FIRSTTIMEFLAG"
fi
# Move the configuration include file into place
cd "$CONFIGDIR"
if [[ -e "${CONFIG_NAME}/Includes.ini" ]] ; then
cp "${CONFIG_NAME}/Includes.ini" .
fi
# Do any update to configuration files that happens each start
cd "$CONFIGDIR"
./scripts/updateConfigFiles.sh