#!bin/sh # # $Revision: 1.8 $ # $Date: 2005/08/08 02:39:46 $ # LANG=C export LANG trap 'exit 3' 15 if [ "$PKG_INSTALL_ROOT" = "/" ]; then PKG_INSTALL_ROOT="" fi # # first check current arch. # CUR_ARCH=`uname -p` CUR_ARCH_EX=$CUR_ARCH if [ "$CUR_ARCH_EX" != "sparc" ]; then # may be it i86pc. CUR_ARCH_EX=i386 fi if [ "$CUR_ARCH_EX" != "sparc" ]; then echo " " echo "This package can only be installed on sparc hardware." echo "This host appears to be a $CUR_ARCH system." echo "Please install the $CUR_ARCH version of this package instead." echo " " exit 1 fi # # Check Package is installed or not. # OTHER_ROOT="-R $PKG_INSTALL_ROOT" if [ "X$PKG_INSTALL_ROOT" = "X" ]; then OTHER_ROOT="" fi NEED_REMOVE_PKG_LIST="" for PKG_LIST in SUNWsscs SUNWscsd SUNWscsu SUNWscsa SUNWscui SUNWsccli SUNWfscs SUNWfscsd SUNWfscsu SUNWfscui SUNWjscs SUNWjscsd SUNWjscsu SUNWjscui SUNWjsccl SUNWcscs SUNWcscsd SUNWcscsu SUNWcscui; do pkginfo $OTHER_ROOT -q $PKG_LIST if [ $? -eq 0 ]; then NEED_REMOVE_PKG_LIST="$PKG_LIST $NEED_REMOVE_PKG_LIST" fi done if [ "X$NEED_REMOVE_PKG_LIST" != "X" ]; then echo " " echo "Remove below package(s) and then try to install this package." echo "$NEED_REMOVE_PKG_LIST" echo " " exit 1 fi # # First we check the JRE version for Console/DR # java -version 2>&1 | grep 'version "1.[2345]' >/dev/null 2>&1 if [ "$?" != "0" ]; then # # ask user to answer is it installed JRE 1.2 # echo "" echo "" echo "To find out the java version currently installed type #java -version" ans=`ckyorn -W 60 -Q -p "Is JRE 1.2.2, 1.3, 1.4, or 1.5 installed? "` if [ "$ans" = n -o "$ans" = no -o "$ans" = N -o "$ans" = NO ]; then echo "" echo "Install JRE 1.2.2, 1.3, 1.4, or 1.5 before installing the console." echo "Sun StorEdge(tm) Configuration Service needs JRE 1.2.2, 1.3, 1.4, or 1.5 to run." echo "The program will try to find it in /usr/java, /usr/jre," echo "/usr/local/java, or /usr/local/jre. " echo "If you installed the JRE in a directory other than" echo "one mentioned above, make a link." echo "" exit 1 fi fi # See if restore cfg is desired here RESTORE_CFG="false" RESTORE_MSG="The previous configuration was saved.\nDo you want to restore the configuration?" # only exist old cfg file save then ask user. if [ -f ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs/sscscon.cfg.tar \ -o -f ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs/sscsagt.cfg.tar \ -o -f ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs/ssdgrptui.cfg.tar \ -o -f ${PKG_INSTALL_ROOT}/var/opt/SUNWsscs/ssdgrptd.cfg.tar \ ]; then ans=`ckyorn -p "$RESTORE_MSG "` if [ $ans = "y" ]; then RESTORE_CFG="true" else if [ $ans = "q" ]; then exit 1 else RESTORE_CFG="false" fi fi fi # # save env vars # cat >$1 <