#!/bin/sh

# This line will be automatically uncommented when you "make install"
installed=1

if [ -z $installed ] ; then
    echo "*** Running uninstalled ManageIndex.exe ***"
    THIS_PATH="../Util:../BeagleClient:."
    THIS_EXE="./ManageIndex.exe"

    export BEAGLE_TOOL_PATH="../tools"
    export MONO_PATH="../Util:../BeagleClient${MONO_PATH+:$MONO_PATH}"
    export LD_LIBRARY_PATH="../glue/.libs${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
    export BEAGLE_FILTER_PATH="../Filters${BEAGLE_FILTER_PATH+:$BEAGLE_FILTER_PATH}"

    if [ -z $BEAGLE_CONF_DIR ]; then
	    export BEAGLE_CONF_DIR="../tools/config-files"
    fi

else
    THIS_PATH="/usr/lib64/beagle"
    THIS_EXE="/usr/lib64/beagle/ManageIndex.exe"

    export MONO_PATH="/usr/lib64/beagle${MONO_PATH+:$MONO_PATH}"
    export LD_LIBRARY_PATH="/usr/lib64/beagle${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
fi

MONO_PATH="$THIS_PATH${MONO_PATH+:$MONO_PATH}" exec -a beagle-manage-index mono $MONO_EXTRA_ARGS $THIS_EXE "$@"

