166 DB2 Deployment Guide
case $OPT in
p) INSTPATH=$OPTARG
mkdir -p $INSTPATH ;;
r) REGVAR=Y ;;
?) echo "invalid command line option $*"
syntax
exit 1 ;;
esac
done
;;
esac
# verify the ODBC driver files and application files are ready
# and then start the deployment
TESTPATH=`echo $0|egrep '^/'`
if [ -z $TESTPATH ]; then
dirname `pwd`/$0|read CURPATH
else
CURPATH=`dirname $0`
fi
cd $CURPATH
if [ ! -d $DIR_DRV ] || [ ! -d $DIR_APP ]; then
echo " ODBC CLI driver or Application directory not existing.\n Abort."
exit 1
fi
# deploy applications and ODBC CLI driver to specified path
cd $INSTPATH
cp -R "$CURPATH/$DIR_APP" .
mkdir -p "$DIR_DRV"
cd $DIR_DRV
for file in "$CURPATH/$DIR_DRV/*.tar.gz"
do
gunzip -c $file|tar -xf -
done
# register system variable
ODBCLIBPATH=`find $INSTPATH/$DIR_DRV -type d -name lib`
case $REGVAR in
Y) echo "
# The following lines have been added by app_install script
export LIBPATH=$LIBPATH:$ODBCLIBPATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ODBCLIBPATH
" >> ~/.profile
if [ `uname` == "AIX" ]; then
echo " export
DB2_CLI_DRIVER_INSTALL_PATH=$DB2_CLI_DRIVER_INSTALL_PATH:$ODBCLIBPATH" >> ~/.profile
fi