aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Alex2016-06-22 12:04:04 +1000
committerBen Alex2016-06-22 12:04:04 +1000
commit29b3df2472db289c22416016ed7b7a5184aae58b (patch)
treebe538ea6f0699a859eb9f1d66ff159256368d71d
parent2356ad244d3a6cd0bd2b6921c02965866086dc16 (diff)
downloadaur-29b3df2472db289c22416016ed7b7a5184aae58b.tar.gz
tws_get_version to reflect latest IB changes:
1. Installer no longer launches TWS automatically 2. Stdout is no longer the place to find the version 3. 'Build' line is no longer with the expected prefix Works OK with 956.2n, which is the current version.
-rwxr-xr-xtws_get_version25
1 files changed, 10 insertions, 15 deletions
diff --git a/tws_get_version b/tws_get_version
index 307db786297f..c8b925059062 100755
--- a/tws_get_version
+++ b/tws_get_version
@@ -20,32 +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
-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
+LOG="${TWS_HOME}/launcher.log"
TWS_CP=`find ${HOME}/Jts/${MAJORVER}/jars -type f -name \*.jar -printf '%p:'`
-java -cp "${TWS_CP}" jclient.LoginFrame "${TWS_HOME}" &>"${LOG_FIFO}" &
+java -cp "${TWS_CP}" jclient.LoginFrame "${TWS_HOME}" &
disown
TWS_PID="$!"
-VERSION_LINE="$(timeout --preserve-status "${TWS_TIMEOUT}" grep -m1 --line-buffered ": Build" "${LOG_FIFO}")"
+# give TWS JVM chance to start writing to $LOG
+x=0
+while [ "$x" -lt 50 -a ! -e /path/to/the/file_name ]; do
+ x=$((x+1))
+ sleep .1
+done
+
+VERSION_LINE="$(timeout --preserve-status "${TWS_TIMEOUT}" grep -m1 --line-buffered " - Build" "${LOG}")"
kill -9 "${TWS_PID}" &>/dev/null
rm -rf $HOME/.install4j $HOME/.i4j_jres $HOME/Jts