aboutsummarylogtreecommitdiffstats
path: root/tws_get_version
diff options
context:
space:
mode:
authorBen Alex2015-11-30 12:38:21 +1100
committerBen Alex2015-11-30 12:51:25 +1100
commit032cd11918d54c8fe0c95c5efd10d5bf7b8f3e90 (patch)
tree10af0e0e5eb22df4e8711e9ba746faefa46afbfa /tws_get_version
parent15aaeeb40e40fb8c095046810481cc04143d2ec4 (diff)
downloadaur-032cd11918d54c8fe0c95c5efd10d5bf7b8f3e90.tar.gz
Support 954.2a, including major changes to IB's release format.
Diffstat (limited to 'tws_get_version')
-rwxr-xr-xtws_get_version28
1 files changed, 9 insertions, 19 deletions
diff --git a/tws_get_version b/tws_get_version
index 8817d43ca140..1aa333ba019f 100755
--- a/tws_get_version
+++ b/tws_get_version
@@ -7,8 +7,8 @@
TWS_TIMEOUT="15"
if ! test -e "$1"; then
- echo "Usage: $0 <jar file | TWS dir>" 1>&2
- echo "Example: $0 $HOME/.tws_scripts/unixmacosx_latest.jar" 1>&2
+ echo "Usage: $0 <sh>" 1>&2
+ echo "Example: $0 $HOME/.tws_scripts/tws-latest-standalone-linux-x64.sh" 1>&2
exit 1
fi
@@ -18,29 +18,17 @@ TDIR="$(mktemp -d -t twsdir.XXXX)" || exit 1
trap "rm -rf ${TDIR}" exit
cd "${TDIR}" || exit 1
-if test -d "${ARG1}"; then
- if test -f "${ARG1}/jts.ini" ;then
- TWS_DIR="${ARG1}"
- else
- echo "error: directory '"${ARG1}"' is not a TWS installation" 2>&1
- exit 1
- fi
-else
- if jar xf "${ARG1}" &>/dev/null && test -f IBJts/jts.jar; then
- TWS_DIR="IBJts"
- else
- echo "error: invalid jar file '"${ARG1}"'" 2>&1
- exit 1
- fi
-fi
+rm -rf $HOME/.install4j $HOME/.i4j_jres $HOME/Jts
+chmod +x ${ARG1}
+${ARG1} -q &> /dev/null
+MAJORVER=$(ls -1 $HOME/Jts)
TWS_HOME="${TDIR}/twshome"
mkdir "${TWS_HOME}" || exit 1
-cp -a "${TWS_DIR}/jts.ini" "${TWS_HOME}" || exit 1
LOG_FIFO="${TDIR}/twslogpipe"
mkfifo "${LOG_FIFO}" || exit 1
-TWS_CP="${TWS_DIR}/jts:${TWS_DIR}/*"
+TWS_CP="${HOME}/Jts/${MAJORVER}/jars/*"
java -cp "${TWS_CP}" jclient.LoginFrame "${TWS_HOME}" &>"${LOG_FIFO}" &
disown
TWS_PID="$!"
@@ -48,6 +36,8 @@ TWS_PID="$!"
VERSION_LINE="$(timeout --preserve-status "${TWS_TIMEOUT}" grep -m1 --line-buffered ": Build" "${LOG_FIFO}")"
kill -9 "${TWS_PID}" &>/dev/null
+rm -rf $HOME/.install4j $HOME/.i4j_jres $HOME/Jts
+
if test "${VERSION_LINE}" == ""; then
echo "could not grep version string" 1>&2
exit 1