From ca7a2ed839f8fec5a7d7abbf50fc2c031f192fb5 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 22 May 2019 19:14:35 +1000 Subject: Major tweaking of the scripts to suit the new setup. --- scripts/start-sim | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'scripts/start-sim') diff --git a/scripts/start-sim b/scripts/start-sim index bd0815f..e82547a 100755 --- a/scripts/start-sim +++ b/scripts/start-sim @@ -38,11 +38,11 @@ fi if [ "x$1" = "x" ]; then tgt=$(basename $(pwd)) num="$(echo ${tgt} | cut -c 4-)" -elif [ -d "./$1" ]; then +elif [ -d "$1" ]; then tgt=$1 -elif [ -d "./sim$1" ]; then +elif [ -d "sim$1" ]; then num=$1 - tgt="./sim${num}" + tgt="sim${num}" else tgt=$1 inventory=$1 @@ -77,14 +77,14 @@ fi case $(basename $0) in "start-sim") - cmd="mono ${exe}.exe -inidirectory=${tgt} " + cmd="mono ${exe}.exe -inidirectory=../../config/${tgt} " # Check if it's already running. if [ -e /var/run/opensim/${tgt}.pid ] then # Double check if it's REALLY running. - if [ "x$(ps -p $(cat /var/run/opensim/${tgt}.pid) --no-headers -o comm)" = "x" ]; then - $SUDO rm -f /var/run/opensim/${tgt}.pid + if [ "x$(ps -p $(cat ${PRGDIR}/../../caches/${tgt}.pid) --no-headers -o comm)" = "x" ]; then + $SUDO rm -f ${PRGDIR}/../../caches/${tgt}.pid fi fi # Now see if it's really really running. lol @@ -92,9 +92,9 @@ case $(basename $0) in then if [ "x$tgt" = "xROBUST" ]; then # TODO - the problem here is that the > bit is executed as onefang, not as opensim. - $SUDO cat ../config/config.ini ../config/Robust.ini.template >../config/Robust.ini -# $SUDO chown -R opensim:opensim ../config/Robust.ini - chmod 640 ../config/Robust.ini + $SUDO cat ${PRGDIR}/../../config/config.ini ${PRGDIR}/../../config/Robust.ini.template >${PRGDIR}/../../config/Robust.ini +# $SUDO chown -R opensim:opensim ${PRGDIR}/../../config/Robust.ini + chmod 640 ${PRGDIR}/../../config/Robust.ini ${tmux_command} split-window -hp 50 -t "${tmux_session}:" "${cmd}" else ${tmux_command} new-window -dn "${title}" -t "${tmux_session}:${num}" "${cmd}" -- cgit v1.1