diff options
author | David Walter Seikel | 2011-11-26 10:09:51 +1000 |
---|---|---|
committer | David Walter Seikel | 2011-11-26 10:09:51 +1000 |
commit | ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f (patch) | |
tree | b25d5ce40da4019db2b7f1552eda19d91677365c /start-sim-in-rest | |
download | IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.zip IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.tar.gz IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.tar.bz2 IGnoble-ebc84ad13f6d3f1911672b1a2d449d8cddf1ae2f.tar.xz |
First commit.
Diffstat (limited to 'start-sim-in-rest')
-rwxr-xr-x | start-sim-in-rest | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/start-sim-in-rest b/start-sim-in-rest new file mode 100755 index 0000000..d6aac2c --- /dev/null +++ b/start-sim-in-rest | |||
@@ -0,0 +1,43 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | osversion="current" | ||
4 | NeedARest=" -console=rest" | ||
5 | NeedARest="" | ||
6 | |||
7 | if [ x$1 = x ]; then | ||
8 | pathname=$(pwd) | ||
9 | tgt=$(basename $pathname) | ||
10 | elif [ -d ./$1 ]; then | ||
11 | tgt=$1 | ||
12 | elif [ -d ./sim$1 ]; then | ||
13 | tgt=sim$1 | ||
14 | fi | ||
15 | |||
16 | if [ x$tgt = x ]; then | ||
17 | echo "usage:" | ||
18 | echo " $ start-sim-in-rest <sim>" | ||
19 | echo "where <sim> is one of: " robust sim[0-9][0-9] | ||
20 | exit 1 | ||
21 | fi | ||
22 | |||
23 | inidir=/opt/opensim/config/${tgt} | ||
24 | bindir=/opt/opensim/${osversion}/bin | ||
25 | if [ x$tgt = xrobust ]; then | ||
26 | exe="Robust" | ||
27 | else | ||
28 | exe="OpenSim" | ||
29 | fi | ||
30 | |||
31 | if [ ! -e /var/run/opensim/${tgt} ] | ||
32 | then | ||
33 | cd ${bindir} | ||
34 | /usr/bin/mono ${exe}.exe -inidirectory=${inidir} -logconfig=${inidir}/${exe}.exe.config $NeedARest | ||
35 | fi | ||
36 | |||
37 | if [ "x$NeedARest" = x } | ||
38 | then | ||
39 | echo "Starting rest client." | ||
40 | cd ${inidir} | ||
41 | /usr/bin/mono ${bindir}/OpenSim.ConsoleClient.exe -logconfig=${inidir}/${exe}.exe.config | ||
42 | fi | ||
43 | |||