#!/bin/bash
ADU_BIN_INSTALLATION_DIR=/opt/hp/hpadu/bld/
export ADU_BIN_INSTALLATION_DIR

ADU_LOCK_FILES_DIR=/opt/hp/hpadu/bld/locks/
export ADU_LOCK_FILES_DIR

export LD_LIBRARY_PATH=/opt/hp/hpadu/bld:/opt/hp/hpadu/bld/lib

#
# need to see if this is a SLES 10 box
SUSEREL="/etc/SuSE-release"
VER=""
if [ -f "$SUSEREL" ]
then
        VER=`grep VERSION $SUSEREL | cut -d' ' -f3 | grep "^10"`
fi

#
# need to see if this is a RHEL5 box
RHREL="/etc/redhat-release"
if [ -f "$RHREL" ]
then
        VER=`grep Tikanga $RHREL`
fi

# Don't set LD_ASSUME_KERNEL on SLES 10 or RHEL5
if [ "$VER" == "" ]
then
        export LD_ASSUME_KERNEL=2.4.1
fi

if [ '/usr/bin/tty -s' -o "$HPLSPINSTALL" = "TRUE" ]; then
   $ADU_BIN_INSTALLATION_DIR.adubin $*
else
   /usr/bin/X11/xterm -T xterm -hold -e $ADU_BIN_INSTALLATION_DIR.adubin $*
   if [ $? != 0 ]; then
      $ADU_BIN_INSTALLATION_DIR.adubin $* 2>/dev/null|cat > /dev/null
   fi
fi
