tasty revision to load feisty for full use
[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/core/launch_feisty_meow.sh"
8 source "$FEISTY_MEOW_SCRIPTS/opensim/opensim_utils.sh"
9
10 # see if the process is findable.
11 # (this approach will not work if the process actually freezes up but
12 # is still present.  we'll never notice the problem.  to catch that, we
13 # could be checking the last update time on the main log file.)
14 find_opensim_process OpenSim.exe
15 if [ -z "$OS_PROC_ID" ]; then
16   # jump into the opensim binaries directory so we can run stuff.
17   pushd $HOME/opensim/bin &>/dev/null
18   launch_screen opensim OpenSim.exe 
19   echo "$(date): Restarted opensim instance on $(hostname)."
20   echo
21   popd &>/dev/null
22 #else echo "$(date): did nothing--opensim is already running."
23 fi
24