fixed name of screen session used.
[feisty_meow.git] / scripts / opensim / maybe_restart_opensim.sh
1 #!/bin/bash
2 # this locates the main opensim process if possible.  if we cannot find it,
3 # then the process is restarted.
4
5 #hmmm: this is really more for osgrid, since opensim has two servers.
6
7 source $FEISTY_MEOW_SCRIPTS/opensim/opensim_utils.sh
8
9 # see if the process is findable.
10 # (this approach will not work if the process actually freezes up but
11 # is still present.  we'll never notice the problem.  to catch that, we
12 # could be checking the last update time on the main log file.)
13 find_opensim_process OpenSim.exe
14 if [ -z "$OS_PROC_ID" ]; then
15   # jump into the opensim binaries directory so we can run stuff.
16   pushd $HOME/opensim/bin &>/dev/null
17   launch_screen opensim OpenSim.exe 
18   echo "$(date): Restarted opensim instance on $(hostname)."
19   echo
20   popd &>/dev/null
21 #else echo "$(date): did nothing--opensim is already running."
22 fi
23