summarylogtreecommitdiffstats
path: root/tws_get_version
diff options
context:
space:
mode:
authorBen Alex2015-12-11 14:38:08 +1100
committerBen Alex2015-12-11 14:46:11 +1100
commit77d83c19c02e0a1aa01406b0c448930aa89b9d10 (patch)
tree1385be0be7830bb2c72692276237ca55f036ab14 /tws_get_version
parente4253f940650d667bb306d6a7f07a647fa6ef904 (diff)
downloadaur-77d83c19c02e0a1aa01406b0c448930aa89b9d10.tar.gz
Changes to support IB TWS's 954.2o release, which now runs TWS
automatically follows an unattended install.
Diffstat (limited to 'tws_get_version')
-rwxr-xr-xtws_get_version16
1 files changed, 14 insertions, 2 deletions
diff --git a/tws_get_version b/tws_get_version
index 1aa333ba019..e85348a40f5 100755
--- a/tws_get_version
+++ b/tws_get_version
@@ -20,15 +20,27 @@ cd "${TDIR}" || exit 1
rm -rf $HOME/.install4j $HOME/.i4j_jres $HOME/Jts
chmod +x ${ARG1}
+
+# as of 954.2o the installer runs TWS, even after unattended install!
+# so we need to install, wait to kill off the nuisance process, and continue
${ARG1} -q &> /dev/null
-MAJORVER=$(ls -1 $HOME/Jts)
+while true
+do
+ pkill -f $HOME/Jts
+ if [ $? -eq 0 ]; then
+ break
+ fi
+done
+
+
+MAJORVER=`find $HOME/Jts -maxdepth 1 -type d -regex '.*/[0-9]*' -printf '%f'`
TWS_HOME="${TDIR}/twshome"
mkdir "${TWS_HOME}" || exit 1
LOG_FIFO="${TDIR}/twslogpipe"
mkfifo "${LOG_FIFO}" || exit 1
-TWS_CP="${HOME}/Jts/${MAJORVER}/jars/*"
+TWS_CP="${HOME}/Jts/${MAJORVER}/jars/jts.jar:${HOME}/Jts/${MAJORVER}/jars/total.jar"
java -cp "${TWS_CP}" jclient.LoginFrame "${TWS_HOME}" &>"${LOG_FIFO}" &
disown
TWS_PID="$!"