From d8b6646a004060edf073b96065fdbb979baa2f68 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 27 Nov 2011 19:31:33 +1000 Subject: Trying to make things safer for upgrades and some general tweaks. --- create_region.sh | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) (limited to 'create_region.sh') diff --git a/create_region.sh b/create_region.sh index ba9de5a..5c27052 100755 --- a/create_region.sh +++ b/create_region.sh @@ -4,7 +4,9 @@ NAME=$1 LOCATION=$2 URL=$3 IP=$4 -cd /opt/opensim/config + +OSPATH="/opt/opensim" +cd $OSPATH/config k=0 for i in $(seq 99) @@ -28,12 +30,8 @@ then echo "WARNING setting the Location to $LOCATION, this may not be what you want." fi -if [ "x$URL" = "x" ] -then - URL=$(hostname) # URL is best (without the HTTP://), but IP (e.g. 88.109.81.55) works too. - echo "WARNING setting the ExternalHostName to $URL, this may not be what you want." -fi - +# Here we make use of an external IP finding service. Careful, it may move. +# We later reuse the same IP for the default URL, coz that should work at least. if [ "x$IP" = "x" ] then # 0.0.0.0 will work for a single sim per physical machine, otherwise we need the real internal IP. @@ -42,6 +40,12 @@ then echo " 0.0.0.0 will work for a single sim per physical machine, otherwise we need the real internal IP." fi +if [ "x$URL" = "x" ] +then + URL=$IP # URL is best (without the HTTP://), but IP (e.g. 88.109.81.55) works too. + echo "WARNING setting the ExternalHostName to $URL, this may not be what you want." +fi + NUM=$(printf "%02d" $(($k + 1)) ) PORT=$(( 9005 + ($k * 5) )) # 9002 is used for HTTP/UDP so START with port 9003! CAUTION Diva/D2 starts at port 9000. UUID=$(uuidgen) @@ -60,21 +64,40 @@ AllowAlternatePorts = False ExternalHostName = $URL zzzzEOFzzzz -ln -s ../../setup/start-sim-in-rest start-sim-in-rest +ln -s ../../setup/start-sim start-sim cp ../../current/bin/OpenSim.exe.config OpenSim.exe.config +sed -i 's@@@' OpenSim.exe.config sed -i "s@@@" OpenSim.exe.config cat > ThisSim.ini << zzzzEOFzzzz [Startup] PIDFile = "/var/run/opensim/sim$NUM.pid" - regionload_regionsdir="/opt/opensim/config/sim$NUM/Regions" + regionload_regionsdir="$OSPATH/config/sim$NUM/Regions" + DecodedSculptMapPath = "caches/sim$NUM/j2kDecodeCache" [Network] console_port = $(( $PORT + 2 )) http_listener_port = $(( $PORT + 0)) -zzzzEOFzzzz -cp ../../current/bin/OpenSim.ConsoleClient.ini OpenSim.ConsoleClient.ini +[AssetCache] + ;; Damn, this gets overidden later by the FlotsamCache.ini file. + ;; At least it says it can be shared by multiple instances. + ; CacheDirectory = "caches/sim$NUM/assetcache" + +[XEngine] + ScriptEnginesPath = "caches/sim$NUM/ScriptEngines" + +[GridService] + MapTileDirectory = "caches/sim$NUM/maptiles" + +[DataSnapshot] + snapshot_cache_directory = "caches/sim$NUM/DataSnapshot" + +[Includes] + Include-Common = config/common.ini + +zzzzEOFzzzz +cp ../OpenSim.ConsoleClient.ini OpenSim.ConsoleClient.ini sed -i "s@; port = 9002@port = $(( $PORT + 2 ))@" OpenSim.ConsoleClient.ini cp ../../setup/opensim-monit.conf opensim-monit.conf -- cgit v1.1