#!/bin/ksh -p
#
# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# ident  "@(#)utusbrun.ksh 1.5     05/05/23 SMI"
#


#
# wrapper to set LD_PRELOAD to use the Sun Ray
# libusb plugin and run application
#


PATH="/bin:/usr/bin:/usr/sbin"

PROG="`basename ${0}`"

function usage {
        print -u2 "usage: ${1} app_name [options]"
}

if [ $# -eq 0 ] 
then
        print -u2 "$PROG: too few arguments"
        usage "${PROG}"
        exit 1
fi

APP="${1}"
shift

LD_PRELOAD="/opt/SUNWut/lib/libusbut.so.1 ${LD_PRELOAD}"

export LD_PRELOAD

exec "${APP}" "$@"
