#!/bin/sh
#
# Copyright (c) 2007-2026 Electric Cloud, Inc.
#
# A simple wrapper script around other binaries that set the necessary
# environment variables before invoking the real binaries.

if [ -d "/opt/ecloud/i686_Linux/apache" ]; then
    # A Cluster Manager installation exists

    MYSQL_HOME=/opt/ecloud/i686_Linux/mysql
    export MYSQL_HOME

    PATH=/opt/ecloud/i686_Linux/apache/bin:/opt/ecloud/i686_Linux/mysql/bin:/opt/ecloud/i686_Linux/bin:$PATH
    LD_LIBRARY_PATH=/opt/ecloud/i686_Linux/apache/lib:/opt/ecloud/i686_Linux/mysql/lib:$LD_LIBRARY_PATH
fi

PATH=/opt/ecloud/i686_Linux/bin:$PATH
LD_LIBRARY_PATH=/opt/ecloud/i686_Linux/lib:/opt/ecloud/i686_Linux/64/lib:$LD_LIBRARY_PATH

export PATH
export LD_LIBRARY_PATH

# Finally, call the real executable.

exec $0.bin "$@"
