aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xcreate_region.sh19
1 files changed, 9 insertions, 10 deletions
diff --git a/create_region.sh b/create_region.sh
index f13eaef..d4c42a8 100755
--- a/create_region.sh
+++ b/create_region.sh
@@ -4,7 +4,6 @@ NAME=$1
4LOCATION=$2 4LOCATION=$2
5URL=$3 5URL=$3
6IP=$4 6IP=$4
7
8cd /opt/opensim/config 7cd /opt/opensim/config
9 8
10k=0 9k=0
@@ -20,21 +19,27 @@ done
20if [ "x$NAME" = "x" ] 19if [ "x$NAME" = "x" ]
21then 20then
22 NAME="No name sim $RANDOM" # Should be unique per grid. 21 NAME="No name sim $RANDOM" # Should be unique per grid.
22 echo "WARNING setting the sim name to [$NAME], this may not be what you want."
23fi 23fi
24 24
25if [ "x$LOCATION" = "x" ] 25if [ "x$LOCATION" = "x" ]
26then 26then
27 LOCATION="$RANDOM,$RANDOM" # again UNIQUE (i.e. ONLY ONE) per grid in THIS case! 27 LOCATION="$RANDOM,$RANDOM" # again UNIQUE (i.e. ONLY ONE) per grid in THIS case!
28 echo "WARNING setting the Location to $LOCATION, this may not be what you want."
28fi 29fi
29 30
30if [ "x$URL" = "x" ] 31if [ "x$URL" = "x" ]
31then 32then
32 URL=$(hostname) # URL is best (without the HTTP://), but IP (e.g. 88.109.81.55) works too. 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."
33fi 35fi
34 36
35if [ "x$IP" = "x" ] 37if [ "x$IP" = "x" ]
36then 38then
37 IP="0.0.0.0" # 0.0.0.0 will work for a single sim per physical machine, otherwise we need the real internal IP. 39 # 0.0.0.0 will work for a single sim per physical machine, otherwise we need the real internal IP.
40 IP=$(wget -q http://automation.whatismyip.com/n09230945.asp -O -)
41 echo "WARNING setting the InternalAddress to $IP, this may not be what you want."
42 echo " 0.0.0.0 will work for a single sim per physical machine, otherwise we need the real internal IP."
38fi 43fi
39 44
40NUM=$(printf "%02d" $(($k + 1)) ) 45NUM=$(printf "%02d" $(($k + 1)) )
@@ -49,23 +54,16 @@ cat > Regions/sim.ini << zzzzEOFzzzz
49[$NAME] 54[$NAME]
50RegionUUID = $UUID 55RegionUUID = $UUID
51Location = $LOCATION 56Location = $LOCATION
52InternalAddress = 0.0.0.0 57InternalAddress = $IP
53InternalPort = $(( $PORT + 1 )) 58InternalPort = $(( $PORT + 1 ))
54AllowAlternatePorts = False 59AllowAlternatePorts = False
55ExternalHostName = $URL 60ExternalHostName = $URL
56zzzzEOFzzzz 61zzzzEOFzzzz
57 62
58ln -s ../../setup/start-sim-in-rest start-sim-in-rest 63ln -s ../../setup/start-sim-in-rest start-sim-in-rest
59#ln -s ../../current current
60cp ../../current/bin/OpenSim.exe.config OpenSim.exe.config 64cp ../../current/bin/OpenSim.exe.config OpenSim.exe.config
61sed -i "s@<file value=\"OpenSim.log\" />@<file value=\"/var/log/opensim/sim$NUM.log\" />@" OpenSim.exe.config 65sed -i "s@<file value=\"OpenSim.log\" />@<file value=\"/var/log/opensim/sim$NUM.log\" />@" OpenSim.exe.config
62 66
63#cp current/bin/OpenSim.ini OpenSim.ini
64#sed -i "s@regionload_regionsdir=\"/opt/opensim/config\"@regionload_regionsdir=\"/opt/opensim/config/sim$NUM/Regions\"@" OpenSim.ini
65#sed -i "s@; PIDFile = \"/var/run/opensim/opensim.pid\"@PIDFile = \"/var/run/opensim/sim$NUM.pid\"@" OpenSim.ini
66#sed -i "s@;http_listener_port = 9000@http_listener_port = $(( $PORT + 0))@" OpenSim.ini
67#sed -i "s@; console_port = 0@console_port = $(( $PORT + 2 ))@" OpenSim.ini
68
69cat > ThisSim.ini << zzzzEOFzzzz 67cat > ThisSim.ini << zzzzEOFzzzz
70[Startup] 68[Startup]
71 PIDFile = "/var/run/opensim/sim$NUM.pid" 69 PIDFile = "/var/run/opensim/sim$NUM.pid"
@@ -81,4 +79,5 @@ sed -i "s@; port = 9002@port = $(( $PORT + 2 ))@" OpenSim.ConsoleClient.ini
81 79
82cp ../../setup/opensim-monit.conf opensim-monit.conf 80cp ../../setup/opensim-monit.conf opensim-monit.conf
83sed -i "s@sim01@sim$NUM@g" opensim-monit.conf 81sed -i "s@sim01@sim$NUM@g" opensim-monit.conf
82sudo chown -R opensim:opensim ..
84 83