From a7219bab0de6c1e22d99cf722b8e588427a012ad Mon Sep 17 00:00:00 2001 From: onefang Date: Thu, 4 Jul 2019 18:16:18 +1000 Subject: Silly script to get around the lack of includes in ROBUST. This'll be temporary until I get around to adding includes to ROBUST. --- scripts/robust-include | 11 +++++++++++ scripts/start-sim | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100755 scripts/robust-include diff --git a/scripts/robust-include b/scripts/robust-include new file mode 100755 index 0000000..e427eb1 --- /dev/null +++ b/scripts/robust-include @@ -0,0 +1,11 @@ +#!/bin/bash + +# Silly script to get around the lack of includes in ROBUST. + +source common.sh +getPrgDir + +# The problem here is that the > bit is executed as the user, not as opensim. +cat ${PRGDIR}/../../config/config.ini ${PRGDIR}/../bin/Robust.ini >${PRGDIR}/../../config/Robust.ini +chown -R ${OS_USER}:${OS_USER} ${PRGDIR}/../../config/Robust.ini +chmod 600 ${PRGDIR}/../../config/Robust.ini diff --git a/scripts/start-sim b/scripts/start-sim index 4bcc803..1414826 100755 --- a/scripts/start-sim +++ b/scripts/start-sim @@ -22,6 +22,7 @@ function wait_for_text() done } + if [ $USER = "${OS_USER}" ] then SUDO="" @@ -91,10 +92,10 @@ case $(basename $0) in if [ ! -e ${PRGDIR}/../../caches/${tgt}.pid ] then if [ "x$tgt" = "xROBUST" ]; then -# TODO - the problem here is that the > bit is executed as the user, not as opensim. - $SUDO cat ${PRGDIR}/../../config/config.ini ${PRGDIR}/../../config/Robust.ini.template >${PRGDIR}/../../config/Robust.ini -# $SUDO chown -R ${OS_USER}:${OS_USER} ${PRGDIR}/../../config/Robust.ini - chmod 640 ${PRGDIR}/../../config/Robust.ini + pushd ${PRGDIR}/../scripts + $SUDO ./robust-include + popd + cmd="${cmd} -inifile=${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