aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/create_region.sh
diff options
context:
space:
mode:
Diffstat (limited to 'create_region.sh')
-rwxr-xr-xcreate_region.sh45
1 files changed, 34 insertions, 11 deletions
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
4LOCATION=$2 4LOCATION=$2
5URL=$3 5URL=$3
6IP=$4 6IP=$4
7cd /opt/opensim/config 7
8OSPATH="/opt/opensim"
9cd $OSPATH/config
8 10
9k=0 11k=0
10for i in $(seq 99) 12for i in $(seq 99)
@@ -28,12 +30,8 @@ then
28 echo "WARNING setting the Location to $LOCATION, this may not be what you want." 30 echo "WARNING setting the Location to $LOCATION, this may not be what you want."
29fi 31fi
30 32
31if [ "x$URL" = "x" ] 33# Here we make use of an external IP finding service. Careful, it may move.
32then 34# We later reuse the same IP for the default URL, coz that should work at least.
33 URL=$(hostname) # URL is best (without the HTTP://), but IP (e.g. 88.109.81.55) works too.
34 echo "WARNING setting the ExternalHostName to $URL, this may not be what you want."
35fi
36
37if [ "x$IP" = "x" ] 35if [ "x$IP" = "x" ]
38then 36then
39 # 0.0.0.0 will work for a single sim per physical machine, otherwise we need the real internal IP. 37 # 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
42 echo " 0.0.0.0 will work for a single sim per physical machine, otherwise we need the real internal IP." 40 echo " 0.0.0.0 will work for a single sim per physical machine, otherwise we need the real internal IP."
43fi 41fi
44 42
43if [ "x$URL" = "x" ]
44then
45 URL=$IP # URL is best (without the HTTP://), but IP (e.g. 88.109.81.55) works too.
46 echo "WARNING setting the ExternalHostName to $URL, this may not be what you want."
47fi
48
45NUM=$(printf "%02d" $(($k + 1)) ) 49NUM=$(printf "%02d" $(($k + 1)) )
46PORT=$(( 9005 + ($k * 5) )) # 9002 is used for HTTP/UDP so START with port 9003! CAUTION Diva/D2 starts at port 9000. 50PORT=$(( 9005 + ($k * 5) )) # 9002 is used for HTTP/UDP so START with port 9003! CAUTION Diva/D2 starts at port 9000.
47UUID=$(uuidgen) 51UUID=$(uuidgen)
@@ -60,21 +64,40 @@ AllowAlternatePorts = False
60ExternalHostName = $URL 64ExternalHostName = $URL
61zzzzEOFzzzz 65zzzzEOFzzzz
62 66
63ln -s ../../setup/start-sim-in-rest start-sim-in-rest 67ln -s ../../setup/start-sim start-sim
64cp ../../current/bin/OpenSim.exe.config OpenSim.exe.config 68cp ../../current/bin/OpenSim.exe.config OpenSim.exe.config
69sed -i 's@<appender name="LogFileAppender" type="log4net.Appender.FileAppender">@<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">@' OpenSim.exe.config
65sed -i "s@<file value=\"OpenSim.log\" />@<file value=\"/var/log/opensim/sim$NUM.log\" />@" OpenSim.exe.config 70sed -i "s@<file value=\"OpenSim.log\" />@<file value=\"/var/log/opensim/sim$NUM.log\" />@" OpenSim.exe.config
66 71
67cat > ThisSim.ini << zzzzEOFzzzz 72cat > ThisSim.ini << zzzzEOFzzzz
68[Startup] 73[Startup]
69 PIDFile = "/var/run/opensim/sim$NUM.pid" 74 PIDFile = "/var/run/opensim/sim$NUM.pid"
70 regionload_regionsdir="/opt/opensim/config/sim$NUM/Regions" 75 regionload_regionsdir="$OSPATH/config/sim$NUM/Regions"
76 DecodedSculptMapPath = "caches/sim$NUM/j2kDecodeCache"
71 77
72[Network] 78[Network]
73 console_port = $(( $PORT + 2 )) 79 console_port = $(( $PORT + 2 ))
74 http_listener_port = $(( $PORT + 0)) 80 http_listener_port = $(( $PORT + 0))
75zzzzEOFzzzz
76 81
77cp ../../current/bin/OpenSim.ConsoleClient.ini OpenSim.ConsoleClient.ini 82[AssetCache]
83 ;; Damn, this gets overidden later by the FlotsamCache.ini file.
84 ;; At least it says it can be shared by multiple instances.
85 ; CacheDirectory = "caches/sim$NUM/assetcache"
86
87[XEngine]
88 ScriptEnginesPath = "caches/sim$NUM/ScriptEngines"
89
90[GridService]
91 MapTileDirectory = "caches/sim$NUM/maptiles"
92
93[DataSnapshot]
94 snapshot_cache_directory = "caches/sim$NUM/DataSnapshot"
95
96[Includes]
97 Include-Common = config/common.ini
98
99zzzzEOFzzzz
100cp ../OpenSim.ConsoleClient.ini OpenSim.ConsoleClient.ini
78sed -i "s@; port = 9002@port = $(( $PORT + 2 ))@" OpenSim.ConsoleClient.ini 101sed -i "s@; port = 9002@port = $(( $PORT + 2 ))@" OpenSim.ConsoleClient.ini
79 102
80cp ../../setup/opensim-monit.conf opensim-monit.conf 103cp ../../setup/opensim-monit.conf opensim-monit.conf