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