Skip to content

improvement: IBController can check if user installed expected offline/standalone TWS version #138

@shevkoplyas

Description

@shevkoplyas

Expected offline TWS version should have the version number as a part of the path to the installation folder. IBController might check that before trying to run TWS.

Since configured IBController already have the knowledge of TWS_MAJOR_VRSN and TWS_PATH we can add the check into IBControllerStart.sh starter script which does following 2 checks:

  1. user didn't forget to specify version number (in below example it simple check "not empty string", but might be more precise and check "represent int number >0 and has 3 digits"
  2. path to TWS installation folder include that version number and exist on the filesystem.
JAVA_PATH=


#              PLEASE DON'T CHANGE ANYTHING BELOW THIS LINE !!
#==============================================================================

# check if TWS version wis specified (must be present in TWS offline version)
if [ "${TWS_MAJOR_VRSN}" == "" ]; then
    echo "error: please set TWS_MAJOR_VRSN variable in $0 script" >&2
    exit 1
fi

# check if TWS directory exit and it has 3-digit version number in it
TWS_OFFLINE_DIR="${TWS_PATH}/${TWS_MAJOR_VRSN}"
if [ ! -d "${TWS_OFFLINE_DIR}" ]; then
    echo
    echo "error: directory '${TWS_OFFLINE_DIR}' does not exist." >&2
    echo "IBController can only work with 'offline' (also known as 'standalone')" >&2
    echo "version of TWS (or IBGateway). One of distinct features of 'offline' version" >&2
    echo "is the presence of TWS version number in the installation directory path." >&2
    echo "Example of 'offline' TWS version default path:" >&2
    echo "   /home/your_user_name/Jts/963" >&2
    echo
    exit 1
fi



#   Notes:
#

Most probably the gramma should be changed.
thanks for great project,
cheers,
Dmitry Shevkoplyas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions