Renames files into new positions to simplify and make organization clearer.

This commit is contained in:
Robert Adams
2022-02-01 21:30:13 +00:00
parent b698e61405
commit 9df47af11d
117 changed files with 735 additions and 0 deletions
+41
View File
@@ -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"