#!/bin/sh

CURR_DIR=`pwd`

CTIPD=`test -h $0 && readlink $0 2> /dev/null`
if [$CTIPD .eq ""]; then
	CTIPD=$0;
fi

CTIPD_BINDIR=${CTIPD_BINDIR:=`dirname $CTIPD`}
CTENGINE_DIR=${CTENGINE_DIR:=$CTIPD_BINDIR}

echo running ctipd from $CTIPD_BINDIR

# this is required in order for ctipd to find its loader.
cd $CTIPD_BINDIR
CMD="./ctipd.bin -l $CURR_DIR $@"

# tell the loader where his libs are
LD_LIBRARY_PATH=$CTENGINE_DIR:$LD_LIBRARY_PATH $CMD
