#!/bin/ksh #set -x #============================================================================ # Express Installation for Demostaration and Evaluation Purposes # # Assumption: - Oracle 8 client library is installed and will be used for # the sample applications demo. # - NAS 4.0 SP2, LDAP 4.0, and NES 4.0 will be installed # on the same machine. #============================================================================ clear echo echo echo "In December of 1999, the Sun-Netscape Alliance announced" echo "" echo " i P l a n e t A p p l i c a t i o n S e r v e r 6.0" echo "" echo " * 100% J2EE compliant" echo " * reliability and high availability for non-stop service required by " echo " the Enterprise" echo " * scalability to go the distance for unplanned success" echo " * the best performance of any web application server" echo " * broadest support of tools for J2EE application development" echo " * high performance and complete solutions for internet enterprise integration" echo echo "Information and availability of this next generation application server " echo "can be found at" echo echo " http://www.iplanet.com/products/infrastructure/app_servers/index.html" echo echo echo "Included in this version of Solaris 8 is an evaluation copy of the " echo "Netscape Application Server v. 4.0 SP2 from iPlanet. " echo echo "Be sure and download additional sample applications from:" echo echo " http://www.iplanet.com/support/technical_resources/nas/" echo echo "Together, the iPlanet products for Unified User Management, for Web" echo "Services, and for Application Services provide " echo echo " T h e f o u n d a t i o n f o r s u c c e s s i n t h e " echo " N e t E c o n o m y." echo echo echo "_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_" echo echo echo "Please press ENTER to continue." echo read CONTINUE if [ X$CONTINUE = "X" ]; then clear else clear fi echo echo echo "BY INSTALLING THIS SOFTWARE YOU ARE CONSENTING TO BE BOUND BY" echo "AND ARE BECOMING A PARTY TO THE AGREEMENT FOUND IN THE LICENSE.TXT" echo "FILE. IF YOU DO NOT AGREE TO ALL OF THE TERMS OF THIS AGREEMENT," echo "PLEASE DO NOT INSTALL OR USE THIS SOFTWARE" echo echo echo "Do you agree to the license terms? [No]: " read AGREE if [[ "$AGREE" = "Y" || "$AGREE" = "y" || "$AGREE" = "YES" || "$AGREE" = "yes" ]] then clear else exit 0 fi ORACLE_HOME=`env |grep ORACLE_HOME |awk -F"=" '{ print $2 } '` ORACLE_SID=`env |grep ORACLE_SID |awk -F"=" '{ print $2 } '` DOMAIN=`/usr/bin/domainname` HOST=`/usr/bin/hostname` IP=`grep $HOST /etc/hosts |awk '{print $1}'` USER_NAME=`/usr/ucb/whoami` DEF_PWD="changeit" CUR_DIR=`/bin/pwd` TMP_DIR="/tmp" INSTALL_TEMPLATE="$CUR_DIR/install.inf.tmplt" INSTALL_INF="$TMP_DIR/install.inf.$$" NAS_USERINPUT_TEMPLATE="`/bin/pwd`/userinput.tmplt" NAS_USERINPUT_LOG="/tmp/userinput.log" #============================================================================= # Prompt for Installation Location (default value: /usr/netscape/server4) # Full Path forWEB Instance # Administrator Password (default value: changeit) # # If user name is not found in the /etc/passwd file, prompt for the group info. # User group (default value: staff) # User group number (default value 10) # # For express installation, the password are set to the same for both # LDAP and NAS administrator. #============================================================================= SVR_ROOT="" echo echo "Please enter the install location [/usr/netscape/server4]: " read SVR_ROOT if [ X$SVR_ROOT = "X" ] then SVR_ROOT="/usr/netscape/server4" fi NAS_ROOT=$SVR_ROOT/nas WEB_PATH="" while [ X$WEB_PATH = "X" ] do echo echo echo "Please enter the FULL PATH of the Web Server Instance to be used" echo "for NAS:" read WEB_PATH done ADMIN_PWD="" echo echo echo "Please enter the password for Netscape Directory Server Adminstrator " echo "and Netscape Application Server Administrator." echo "The password needs to tb be at least 8 characters. [changeit]: " echo ADMIN_PWD=`$CUR_DIR/getpw` if [ X$ADMIN_PWD = "X" ]; then ADMIN_PWD=$DEF_PWD else pwdLength=`echo $ADMIN_PWD |awk '{print length($1)}'` if [ $pwdLength -lt 8 ] then while [ $pwdLength -lt 8 ] do echo "Please enter a password containing at least 8 characters. " ADMIN_PWD=`$CUR_DIR/getpw` pwdLength=`echo $ADMIN_PWD |awk '{print length($1)}'` done fi fi PWD_LINE=`grep $USER_NAME /etc/passwd` if [ $? ]; then USER_GRP_NUM=`echo $PWD_LINE |awk -F":" '{ print $4 }'` USER_GRP=`cat /etc/group |awk -F":" '$3=="'$USER_GRP_NUM'" {print $1}'` fi #if [ X$USER_GRP_NUM = "X" ] #then # echo # echo "Your user name is not found in the /etc/passwd file on this system" # echo "Please enter your group information." # echo # echo "Sysetm Group Number [10]: \c" # read USER_GRP_NUM # if [ X$USER_GRP_NUM = "X" ]; then # USER_GRP_NUM=10 # fi # echo # echo "Sysetem Group [staff]: \c" # read USER_GRP # if [ X$USER_GRP = "X" ]; then # USER_GRP="staff" # fi #fi SED="/bin/sed" if [ X$USER_GRP_NUM = "X" ]; then GRP_LINE=`id |awk -F"=" '{ print $3 }' |$SED "s,(,|,g" |$SED "s,),|,g"` USER_GRP_NUM=`echo $GRP_LINE |awk -F"|" '{ print $1 }' ` USER_GRP=`echo $GRP_LINE |awk -F"|" '{ print $2 }' ` fi #============================================================================= # Creating install.inf and userinput.log file with the template files # and user input. #============================================================================= cat $INSTALL_TEMPLATE |$SED "s,hostname,$HOST,g" |$SED "s,domain,$DOMAIN,g"|$SED "s,127.0.0.1,$IP,g" |$SED "s,username,$USER_NAME,g" |$SED "s,usergroup,$USER_GRP,g" |$SED "s,ldap_server_root,$SVR_ROOT,g" |$SED "s,adminpwd,$ADMIN_PWD,g" > $INSTALL_INF cat $NAS_USERINPUT_TEMPLATE |$SED "s,nas_backup_dir,$NAS_ROOT/backup,g" |$SED "s,ldap_server_root,$SVR_ROOT,g" |$SED "s,hostname,$HOST,g" |$SED "s,domain,$DOMAIN,g" |$SED "s,127.0.0.1,$IP,g" |$SED "s,username,$USER_NAME,g" |$SED "s,usergroup,$USER_GRP,g" |$SED "s,user_grp_num,$USER_GRP_NUM,g" |$SED "s,nas_home,$NAS_ROOT,g" |$SED "s,nes_home,$WEB_PATH,g" |$SED "s,adminpwd,$ADMIN_PWD,g"| $SED "s,nas_userinput_log,$NAS_USERINPUT_LOG,g" |$SED "s,oracle_dir,$ORACLE_HOME,g" | $SED "s,oracle_sid,$ORACLE_SID,g" > $NAS_USERINPUT_LOG #============================================================================= # Run silent install with install.inf and userinput.log files generated # from previous steps. #============================================================================= ./setup -s -f $INSTALL_INF /bin/mv $INSTALL_INF $SVR_ROOT/nas/install.inf 2> /dev/null