#! /bin/sh

bindir=`dirname $0`
bindir=`cd $bindir;pwd`

progname=`basename $0 | sed s/^arc// | sed s/^ng//`

if [ -z "$GLOBUS_LOCATION" ] ; then
    if [ -e /etc/sysconfig/globus ] ; then
        . /etc/sysconfig/globus
    fi
fi

if [ -n "$GLOBUS_LOCATION" ] ; then
    export GLOBUS_LOCATION
fi

if [ -e "$GLOBUS_LOCATION/etc/globus-user-env.sh" ] ; then
    . "$GLOBUS_LOCATION/etc/globus-user-env.sh"
fi

# Assume bindir is just below prefix
ARC_LOCATION=`dirname $bindir`
export ARC_LOCATION

export LD_LIBRARY_PATH=$ARC_LOCATION/`basename $bindir`/../lib:$LD_LIBRARY_PATH

$bindir/arccli $progname "$@"
