diff options
Diffstat (limited to '')
| -rwxr-xr-x | create_region.sh | 45 |
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 | |||
| 4 | LOCATION=$2 | 4 | LOCATION=$2 |
| 5 | URL=$3 | 5 | URL=$3 |
| 6 | IP=$4 | 6 | IP=$4 |
| 7 | cd /opt/opensim/config | 7 | |
| 8 | OSPATH="/opt/opensim" | ||
| 9 | cd $OSPATH/config | ||
| 8 | 10 | ||
| 9 | k=0 | 11 | k=0 |
| 10 | for i in $(seq 99) | 12 | for 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." |
| 29 | fi | 31 | fi |
| 30 | 32 | ||
| 31 | if [ "x$URL" = "x" ] | 33 | # Here we make use of an external IP finding service. Careful, it may move. |
| 32 | then | 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." | ||
| 35 | fi | ||
| 36 | |||
| 37 | if [ "x$IP" = "x" ] | 35 | if [ "x$IP" = "x" ] |
| 38 | then | 36 | then |
| 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." |
| 43 | fi | 41 | fi |
| 44 | 42 | ||
| 43 | if [ "x$URL" = "x" ] | ||
| 44 | then | ||
| 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." | ||
| 47 | fi | ||
| 48 | |||
| 45 | NUM=$(printf "%02d" $(($k + 1)) ) | 49 | NUM=$(printf "%02d" $(($k + 1)) ) |
| 46 | PORT=$(( 9005 + ($k * 5) )) # 9002 is used for HTTP/UDP so START with port 9003! CAUTION Diva/D2 starts at port 9000. | 50 | PORT=$(( 9005 + ($k * 5) )) # 9002 is used for HTTP/UDP so START with port 9003! CAUTION Diva/D2 starts at port 9000. |
| 47 | UUID=$(uuidgen) | 51 | UUID=$(uuidgen) |
| @@ -60,21 +64,40 @@ AllowAlternatePorts = False | |||
| 60 | ExternalHostName = $URL | 64 | ExternalHostName = $URL |
| 61 | zzzzEOFzzzz | 65 | zzzzEOFzzzz |
| 62 | 66 | ||
| 63 | ln -s ../../setup/start-sim-in-rest start-sim-in-rest | 67 | ln -s ../../setup/start-sim start-sim |
| 64 | cp ../../current/bin/OpenSim.exe.config OpenSim.exe.config | 68 | cp ../../current/bin/OpenSim.exe.config OpenSim.exe.config |
| 69 | sed -i 's@<appender name="LogFileAppender" type="log4net.Appender.FileAppender">@<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender">@' OpenSim.exe.config | ||
| 65 | sed -i "s@<file value=\"OpenSim.log\" />@<file value=\"/var/log/opensim/sim$NUM.log\" />@" OpenSim.exe.config | 70 | sed -i "s@<file value=\"OpenSim.log\" />@<file value=\"/var/log/opensim/sim$NUM.log\" />@" OpenSim.exe.config |
| 66 | 71 | ||
| 67 | cat > ThisSim.ini << zzzzEOFzzzz | 72 | cat > 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)) |
| 75 | zzzzEOFzzzz | ||
| 76 | 81 | ||
| 77 | cp ../../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 | |||
| 99 | zzzzEOFzzzz | ||
| 100 | cp ../OpenSim.ConsoleClient.ini OpenSim.ConsoleClient.ini | ||
| 78 | sed -i "s@; port = 9002@port = $(( $PORT + 2 ))@" OpenSim.ConsoleClient.ini | 101 | sed -i "s@; port = 9002@port = $(( $PORT + 2 ))@" OpenSim.ConsoleClient.ini |
| 79 | 102 | ||
| 80 | cp ../../setup/opensim-monit.conf opensim-monit.conf | 103 | cp ../../setup/opensim-monit.conf opensim-monit.conf |
