: ' : ************************************************************************* : : INFORMIX SOFTWARE, INC. : : PROPRIETARY DATA : : THIS DOCUMENT CONTAINS TRADE SECRET DATA WHICH IS THE PROPERTY OF : INFORMIX SOFTWARE, INC. THIS DOCUMENT IS SUBMITTED TO RECIPIENT IN : CONFIDENCE. INFORMATION CONTAINED HEREIN MAY NOT BE USED, COPIED OR : DISCLOSED IN WHOLE OR IN PART EXCEPT AS PERMITTED BY WRITTEN AGREEMENT : SIGNED BY AN OFFICER OF INFORMIX SOFTWARE, INC. : : THIS MATERIAL IS ALSO COPYRIGHTED AS AN UNPUBLISHED WORK UNDER : SECTIONS 104 AND 408 OF TITLE 17 OF THE UNITED STATES CODE. : UNAUTHORIZED USE, COPYING OR OTHER REPRODUCTION IS PROHIBITED BY LAW. : : : Title: install : Sccsid: @(#)install 9.33 1/31/94 14:54:29 : Description: Installation Script : : usage: install files_list : : ignores blank lines and lines starting with #, DISK, : space, or tab : : ********************************************************************** : ' # For format of files_list files refer to bin/fileslist.doc if test "x$1" = "x" then echo "Usage: install files_list" exit 1 fi FILELIST=$1 if [ "$2" != "NOCHK" ] then echo ' Installation Script This installation procedure must be run by root (super-user). It will change the owner, group, and mode of all files of this package in this directory. There must be a user "informix" and a group "informix" known to the system. ' echo install >__install__ chown root __install__ 2> /dev/null if test $? -ne 0 then echo ' Please rerun this installation procedure as super-user. ' rm __install__ exit 1 fi : 'Need another test for Sys 5 since chown is valid for files you own' # # The owner of __install__ is root now. The chmod 4755 is used to # test whether the user is root. # chmod 4755 __install__ 2> /dev/null if test $? -ne 0 then echo ' Please rerun this installation procedure as super-user. ' rm -f __install__ exit 1 fi rm __install__ echo ' Press RETURN to continue, or the interrupt key (usually CTRL-C or DEL) to abort. ' read I # Check INFORMIXDIR is set, and we're in it if test "x$INFORMIXDIR" = "x" then echo "INFORMIXDIR is not set." exit 1 fi if test $INFORMIXDIR != `pwd` then echo "INFORMIXDIR and working directory do not match." echo "INFORMIXDIR is set to $INFORMIXDIR" echo "Current working directory is `pwd`" exit 1 fi # This is the end of if NOCHK clause fi #Now check for NOBRAND argument if [ "$3" = "NOBRAND" ] then BRAND="/bin/true";export BRAND else unset BRAND >/dev/null 2>&1 fi # Get product name grep "^PRODUCT" $FILELIST > _product read keywd PRODUCT < _product rm -f _product # Get data for licensed feature FNAME=""; RELEASE="" grep "^NAME" $FILELIST > _feature read keywd1 FNAME keywd2 RELEASE < _feature rm -f _feature SERNUM="AAA#B000000" KEY="NOZDIP" USERCODE=`echo $SERNUM | sed -e 's-^....--' | sed -e 's-......$--'` LIMIT=true; EVAL=false; SINGLUSR=false case $USERCODE in I | O | N ) echo "WARNING: This is an invalid serial number."; echo " Exiting install program."; exit 1;; *) ;; esac echo " " echo "WARNING!" echo " This software, and its authorized use and number of users, are" echo "subject to the applicable license agreement with Informix Software Inc." echo "If the number of users exceeds the licensed number, the excess users may" echo "be prevented from using the software. UNAUTHORIZED USE OR COPYING MAY" echo "SUBJECT YOU AND YOUR COMPANY TO SEVERE CIVIL AND CRIMINAL LIABILITIES." echo "" echo ' Press RETURN to continue, or the interrupt key (usually CTRL-C or DEL) to abort. ' read I tdydate=`date +%y%m%d` # date used to backup files when necessary. BRAND=${BRAND:=etc/brand} if test -s /bin/ranlib then RANLIB=/bin/ranlib elif test -s /usr/bin/ranlib then RANLIB=/usr/bin/ranlib else RANLIB= fi while read NAM OWN GRP MOD FLG FLG2 do case $NAM in \#* | "" | " "* | " "* | DISK* ) continue ;; NAME* ) continue ;; PRODUCT* ) continue ;; esac if test -d $NAM then echo "Installing directory $NAM" fi case $FLG in BRAND ) $BRAND -n -s $SERNUM $KEY $NAM if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi ;; ELINK ) if test -s $FLG2 then ln $FLG2 $NAM if test $? -ne 0 then echo "Installation of $PRODUCT failed to link $NAM to $FLG2" exit 1 fi echo "$NAM linked to existing file $FLG2" else NAM="" fi ;; LINK ) rm -f $NAM ln $FLG2 $NAM if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi ;; REMOVE ) rm -f $NAM if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi NAM="" ;; RENAME ) if test ! -f $FLG2 then mv $NAM $FLG2 if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi NAM=$FLG2 else if test ! -f $NAM then NAM="" fi fi ;; REPLACE ) if test -f $NAM then if test -f $FLG2 then # make sure we don't backup twice in the same day if test ! -f $FLG2.$tdydate then # file hasn't been backed up today, do it mv $FLG2 $FLG2.$tdydate echo "A new version of $FLG2 will be installed," echo "Previous version of $FLG2 is saved as $FLG2.$tdydate" else # file already backed up today rm -f $FLG2 fi fi mv $NAM $FLG2 if test $? -ne 0 then echo "Installation of $PRODUCT failed" exit 1 fi NAM=$FLG2 else NAM="" fi ;; esac case $NAM in *.a ) if (test "$RANLIB" != "") then $RANLIB $NAM if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi fi ;; esac if test "x$NAM" != "x" then chown $OWN $NAM if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi chgrp $GRP $NAM if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi chmod $MOD $NAM if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi fi done < $FILELIST # Since above while loop is executed in subshell, need to exit script if # there were any errors. if test $? -ne 0 then exit 1 fi # # See if there are any Shared Libraries to be installed in system dirs # if grep SHARELIB $FILELIST > /dev/null 2>&1 then echo "" echo "Installing Shared Libraries in System Directories ... " # See if machine supports symbolic links echo symlink > _linkfile ln -s _linkfile __linkfile if test $? -eq 0 then SHCMD="ln -s" else SHCMD="cp" fi rm -f _linkfile __linkfile # Now link or copy each shared library grep SHARELIB $FILELIST | while read NAM OWN GRP MOD FLG FLG2 do if test "$FLG" = "SHARELIB" then backup=no if test -f $FLG2 then # make sure we don't backup twice in the same day if test ! -f $FLG2.$tdydate then # file hasn't been backed up today, do it mv $FLG2 $FLG2.$tdydate backup=yes fi fi # force removal of the file, which could be a link to a non- # existent file (e.g. if INFORMIXDIR has been renamed). rm -f $FLG2 if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi if test "$SHCMD" = "cp" then echo "Copying $NAM to $FLG2" else echo "Linking $FLG2 from $NAM" fi $SHCMD $INFORMIXDIR/$NAM $FLG2 if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi if test $backup = yes then echo "Previous version of $FLG2 saved as $FLG2.$tdydate" fi echo "" fi done # Since above while loop is executed in subshell, need to exit script if # there were any errors. if test $? -ne 0 then exit 1 fi fi # # record the product name and serial number in etc/.snfile # for all products except C-ISAM # case $PRODUCT in C-ISAM* ) ;; * ) echo $PRODUCT " Serial Number " $SERNUM >> etc/.snfile if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi chgrp informix etc/.snfile if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi chmod 600 etc/.snfile if test $? -ne 0 then echo "Installation of $PRODUCT failed." exit 1 fi ;; esac # Create date file if product is DRDA-GW if test "x$FNAME" != "x" then if test "$FNAME" = "ifmxgw" then if test ! -s etc/.gw then date > etc/.gw chmod 440 etc/.gw chown informix etc/.gw chgrp informix etc/.gw if test $? -ne 0 then echo "Cannot create etc/.gw file" rm -f etc/.gw exit 1 fi fi fi fi if [ "$2" != "NOCHK" ] then echo " Installation of $PRODUCT complete. " fi exit 0