home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Plus! (NZ) 2001 July
/
TRIAL_ENTCDJB4.iso
/
JBuilder
/
ias
/
setup.sh
< prev
next >
Wrap
Linux/UNIX/POSIX Shell Script
|
2000-08-30
|
3KB
|
167 lines
#!/bin/sh
#
#
# Script variables
#
DONE=NO
#if [ -f "$1" ]; then
if [ ${1} ]; then
SDIR="$1"
cd $SDIR
else
SDIR=`pwd`
fi
if [ ${2} ]; then
shift
JREPATH=$1
fi
OS=`uname -s`
OS_VERSION=`uname -a`
OS_DISPLAY="Default"
#
# Script functions
#
exit_install()
{
# Move back to installdir to avoid cleanup errors
cd $SDIR
PROMPT=0
if [ "$1" = "-p" ]; then
PROMPT=1
shift
fi
# Wait For Confirmation, Then Bye-Bye
if [ "$PROMPT" = "1" ]; then
echo ""
echo "Hit return to exit..."
read
fi
exit $1
}
get_platform()
{
case "${OS}"
in
SunOS )
OS_DISPLAY="Solaris"
OS_VERSION="sun5_5_sparc"
INSTALL_IAS="sun5_5_sparc"
;;
Linux )
OS_DISPLAY="Linux"
OS_VERSION="redhat6_1"
INSTALL_IAS="redhat6_1"
;;
HP-UX)
OS_VERSION=`uname -a | cut -f3 -d' ' | cut -f2 -d'.'`
OS_DISPLAY="HP-UX ${OS_VERSION}"
INSTALL_IAS="hpux_11"
;;
AIX)
OS_VERSION_MAJOR=`uname -a | cut -f4 -d' '`
OS_VERSION_MINOR=`uname -a | cut -f3 -d' '`
OS_DISPLAY="AIX ${OS_VERSION_MAJOR}.${OS_VERSION_MINOR}"
OS_VERSION="${OS_VERSION_MAJOR}.${OS_VERSION_MINOR}"
OS_BIT_SIZE=`lslpp -l | grep bos.64bit | grep COMMITTED`
INSTALL_IAS="aix4_3"
;;
* )
INSTALL_IAS="sun5_5_sparc"
;;
esac
}
get_input()
{
NONULL=
if [ "$1" = "-n" ]; then
NONULL=1
shift
fi
PROMPT="$1"
while [ 1 ]; do
if [ ! -z "$2" ]; then
echo "$1 [Default: $2] (q to quit): \c"
else
echo "$1 (q to quit): \c"
fi
read INPUT
if [ "$INPUT" = q -o "$INPUT" = Q -o "$INPUT" = quit -o "$INPUT" = QUIT ]; then
echo " You can rerun this installation at any time."
exit_install 2
fi
if [ "$NONULL" = "1" -a -z "$INPUT" ]; then
echo ""
echo "Entry must not be blank. Please try again."
continue
elif [ -z "$INPUT" -a ! -z "$2" ]; then
INPUT="$2"
fi
break
done
}
DisplayOptions()
{
echo ""
echo " Inprise Application Server 4.1 Installation Selections for ${OS_DISPLAY}"
LINE=0
if [ -d $SDIR/install/ias/${INSTALL_IAS} ]
then
LINE=`expr $LINE + 1`
echo " ${LINE}: Install Application Server"
fi
}
ProcessOption()
{
LINE=0
if [ -d $SDIR/install/ias/${INSTALL_IAS} ]
then
cd $SDIR/install/ias/${INSTALL_IAS}
./setup "$JREPATH"
cd ${SDIR}
fi
}
#ProcessOption()
#{
#LINE=0
#if [ -d $SDIR/install/ias/${INSTALL_IAS} ]
#then
#LINE=`expr $LINE + 1`
#if [ "${OPTION_SELECT}" = "${LINE}" ]
#then
#cd install/ias/${INSTALL_IAS}
#./setup
#cd ${SDIR}
#fi
#fi
#}
#
# Script "main"
#
while [ "${DONE}" = "NO" ]
do
get_platform
#DisplayOptions
#get_input " Which would you like to do ? "
#OPTION_SELECT=${INPUT}
ProcessOption
exit
done