mirror of
https://github.com/Misterblue/opensim-docker.git
synced 2026-07-30 03:12:41 +00:00
Renames files into new positions to simplify and make organization clearer.
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
#! /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}
|
||||
|
||||
# For this image, CONFIG_NAME is the configuration being used
|
||||
CONFIG_NAME=${CONFIG_NAME:-standalone}
|
||||
CONFIGDIR=${OPENSIMBIN}/config/${CONFIG_NAME}
|
||||
|
||||
cd "$CONFIGDIR"
|
||||
source ../setEnvironment.sh
|
||||
|
||||
# Update EXTERNAL_HOSTNAME
|
||||
cd "$OPENSIMBIN"
|
||||
for file in $OPENSIMBIN/Regions/*.ini $CONFIGDIR/Regions/*.ini ; do
|
||||
if [[ -e "$file" ]] ; then
|
||||
sed --in-place -e "s/^ExternalHostName = .*$/ExternalHostName = \"${EXTERNAL_HOSTNAME}\"/" "$file"
|
||||
fi
|
||||
done
|
||||
|
||||
# Add EXTERNAL_HOSTNAME to the common configuation in OpenSim.ini
|
||||
sed --in-place -e "s/^ *BaseHostname = .*$/ BaseHostname = ${EXTERNAL_HOSTNAME}/" "$OPENSIMBIN/OpenSim.ini"
|
||||
|
||||
# If the environment variables haven't been copied into misc.ini, do it now
|
||||
# If the replacement has already happened, this is a NOOP
|
||||
if [[ -e "${CONFIGDIR}/misc.ini.prototype" ]] ; then
|
||||
cp "${CONFIGDIR}/misc.ini.prototype" "${CONFIGDIR}/misc.ini"
|
||||
fi
|
||||
sed --in-place \
|
||||
-e "s/MYSQL_DB_USER/$MYSQL_DB_USER/" \
|
||||
-e "s/MYSQL_DB_SOURCE/$MYSQL_DB_SOURCE/" \
|
||||
-e "s/MYSQL_DB_DB/$MYSQL_DB_DB/" \
|
||||
-e "s/MYSQL_DB_PASSWORD/$MYSQL_DB_PASSWORD/" \
|
||||
-e "s/PW_FOR_DEFAULT_ESTATE_OWNER/$PW_FOR_DEFAULT_ESTATE_OWNER/" \
|
||||
-e "s/DEFAULT_ESTATE_NAME/$DEFAULT_ESTATE_NAME/" \
|
||||
-e "s/DEFAULT_ESTATE_OWNER/$DEFAULT_ESTATE_OWNER/" \
|
||||
"${CONFIGDIR}/misc.ini"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user