:
#
# Copyright (c) 1988, 1999 Oracle Corporation.  All rights reserved.
#
# NAME
#   pupbld
#
# DESCRIPTION
#   Script to install SQL*Plus PRODUCT_USER_PROFILE tables
#
# NOTES

#
#  Display abort message on interupt.
#
trap 'echo "^G^G Product_User_Profile Installation Aborted!"; exit' 1 2 3 15

#
#  Allow verification/trace to be turned on and off.
#  When verification is off, the default case, invoke sqlplus with the
#  -silent option.
case "$ORACLE_TRACE" in
    "T")        set -x ;;
     *)        SILENT="-s" ;;
esac

#
#  If LOG is not set, then send output to /dev/null.
#
case $LOG in
    "") LOG=/dev/null ;;
esac

#
#  Check to make sure that required variables are set.
#  If they are not, prompt user to set them and restart install.
#

case $ORACLE_HOME in
    "") echo "ORACLE_HOME not set."
        echo "Set and export ORACLE_HOME, then restart profile installation." | tee -a $LOG
        exit 1 ;;
esac

case $SYSTEM_PASS in
    "") echo "SYSTEM_PASS not set."
        echo "Set and export SYSTEM_PASS, then restart profile installation." | tee -a $LOG
        exit 1 ;;
esac
echo ""
echo "Installing product user profile tables..."
echo ""
PUPBLD=$ORACLE_HOME/sqlplus/admin/pupbld
sqlplus  $SYSTEM_PASS >> $LOG 2> /dev/null  <<!
	start $PUPBLD
	exit
!
echo "Product user profile tables installed."
echo ""
