Files
opensim-docker/opensim-standalone/config/scripts/updateConfigFiles.sh
T
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

21 lines
728 B
Bash
Executable File

#! /bin/bash
# Before running OpenSimulator, we update the configuration files
# for the current running environment.
# This is run before every OpenSimulator run to update changing parameters.
OPENSIMBIN=${OPENSIMBIN:-/home/opensim/opensim/bin}
CONFIGDIR=${CONFIGDIR:-$OPENSIMBIN/config}
cd "$CONFIGDIR"
source ./scripts/setEnvironment.sh
# Update EXTERNAL_HOSTNAME
cd "$OPENSIMBIN"
for file in $OPENSIMBIN/Regions/*.ini $CONFIGDIR/$CONFIG_NAME/Regions/*.ini ; do
if [[ -e "$file" ]] ; then
sed --in-place -e "s/^ExternalHostName = .*$/ExternalHostName = \"${EXTERNAL_HOSTNAME}\"/" "$file"
fi
done
sed --in-place -e "s/^ *BaseHostname = .*$/ BaseHostname = ${EXTERNAL_HOSTNAME}/" "$OPENSIMBIN/OpenSim.ini"