blob: 4738c2e6cbb3da2a1a3f678f9bf7ced8b8802c1b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
#!/bin/bash
# Pick one of these depending on how you want your access.
# NOTE - REST does not work. B-(
#NeedARest=" -console=rest"
NeedARest=""
Screaming="true"
#Screaming=""
USER=$(whoami)
console_name=screen_console
if [ "$USER" = "opensim" ]
then
screen_session=opensim/${console_name}
screen_check="screen -ls opensim/"
else
screen_session=${console_name}
screen_check="screen -ls"
fi
osversion="current"
if [ "x$1" = "x" ]; then
pathname=$(pwd)
tgt=$(basename $pathname)
elif [ -d "./$1" ]; then
tgt=$1
elif [ -d "./sim$1" ]; then
tgt=sim$1
fi
if [ "x$tgt" = "x" ]; then
echo "usage:"
echo " $ start-sim-in-rest <sim>"
echo "where <sim> is one of: " robust sim[0-9][0-9]
exit 1
fi
if [ "x$Screaming" = "xtrue" ]
then
if ($screen_check | grep -q ${console_name}); then
echo "INFO: Screen already running"
true
else
echo "DEBUG: Starting screen"
screen -d -m -S ${console_name}
fi
fi
if [ "x$tgt" = "xrobust" ]; then
exe="Robust"
else
exe="OpenSim"
fi
inidir=/opt/opensim/config/${tgt}
bindir=/opt/opensim/${osversion}/bin
cmd="/usr/bin/mono ${exe}.exe -inidirectory=${inidir} -logconfig=${inidir}/${exe}.exe.config $NeedARest"
# Check if it's already running.
if [ ! -e /var/run/opensim/${tgt} ]
then
if [ "x$Screaming" = "xtrue" ]
then
tmpfile=`mktemp`
echo "chdir ${bindir}" > ${tmpfile}
echo "screen -t ${tgt} ${cmd}" >> ${tmpfile}
chmod a+r ${tmpfile}
rm -f ${inidir}/start.screen
cp ${tmpfile} ${inidir}/start.screen
rm ${tmpfile}
# echo "INFO: start process and connect to screen (opensim)"
screen -r ${screen_session} -p "-" -X source ${inidir}/start.screen
else
cd ${bindir}
$cmd
fi
fi
# Either way, need to start up the console after.
if [ "x$Screaming" = "xtrue" ]
then
echo "Starting screen client."
screen -r ${screen_session} -A
elif [ "x$NeedARest" != "x" ]
then
echo "Starting rest client."
cd ${inidir}
/usr/bin/mono ${bindir}/OpenSim.ConsoleClient.exe -logconfig=${inidir}/${exe}.exe.config
fi
|