home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1997-09-08 | 27.5 KB | 1,139 lines
#! /bin/sh # # @(#) install Version 1.6 Created 96/12/06 12:29:23 # ------------------------------------------------------------------------ # Copyright (C) JSB Computer Systems Ltd, 1996. # # This module contains proprietary information of JSB Computer Systems Ltd, # and should be treated as Confidential. # # # install/mvw.license - Installation and User License upgrade Script # for MultiView Mascot 4.0.x # ------------------------------------------------------------------------ ## # Common Environment Variables. ## HOMEDIR=`pwd` CENTRAL=$HOMEDIR/mvw ## the default central directory for install DEFAULTCENTRAL=/usr/mvw ## the default central directory for mvw.license ## NB #MVWDIR overrides $DEFAULTCENTRAL BINDIR=/usr/bin ## Default Demonstration Key DEMOPREFIX=JSB DEMONUMBER=999999 DEMOKEY=BN8DzD7n ## Compressed file name TARFILE=Mascot.tar EXPANDFILE=$TARFILE.Z if [ -x /usr/5bin/echo ] then ECHO=/usr/5bin/echo else ECHO=echo fi PAGER=${PAGER:-more} README=readme ## make sure permissions in the central directory are OK CHECK_PERMS=TRUE ## Auto brand vars AUTOBRAND=FALSE NEWKEY=FALSE ## ## Internationalisation begins here ## # Error Messages. ## ERR01=" Could not find " ERR02="failed with following error :" ERR03="aborted\n" ERR04=" Incorrect serialisation" ERR05=" Could not create directory " ERR06=" Could not change permissions on directory " ERR07=" You are installing from the wrong directory - check installation notes" ERR08=" Missing file - " ERR09=" Could not change ownership for " ERR10=" Could not change group for " ERR11=" Could not link Mascot " ERR12=" Could not link Host Support " ERR13=" Serialisation aborted at user request " ERR14=" Installation aborted at user request " ERR15=" Could not change permissions for " ERR16=" Could not create backup directory " ERR17=" Conversion of command file(s) failed, please see audit.txt" ERR18=" File expansion has failed" BRAND00="\nSerial Number OK." BRAND01="\nInvalid Serial Number / Activation Key sequence." BRAND02="\nSerial Number or Activation Key has incorrect format." BRAND03="\nInvalid upgrade path - no action taken." BRAND04="\nThis key has already been used." BRAND05="\nYou must run as root to install / upgrade." BRAND06="\nInvalid argument." BRAND07="\nFailed to access Mascot." BRAND08="\nFailed to access Host Support." BRAND09="\nFailed to open binary." BRAND10="\nFailed to write binary stamp area." BRAND11="\nFailed to find the binary stamp area." BRAND12="\nFailed to read the binary stamp area." BRAND13="\nInvalid Serial Number / Activation Key sequence." BRAND14="\nFailed to open binary because somebody else is using it." BRAND15="\nSerial number does not match product." BRAND16="\nInternal error - key does not match product." BRAND17="\nFailed to access license configuration file - check MVWDIR." BRAND18="\nLicense configuration corrupt - the product should be reinstalled." BRAND19="\n\nChecking for existing Mascot serial numbers and activation keys\n" BRAND20="Autobranding binaries with serial no.: " BRAND21=" and act. key: " LIC01="This procedure may be used to increase your MultiView Mascot user license.\nTo do this you must :\n\n1. Be a running as a super-user ( root )\n2. Make sure that no one is using MultiView Mascot or the\n MultiView DeskTop Host Support Server.\n\nDo you wish to continue \c" LIC02="Can't find Mascot Central Directory - type in the pathname\c" ## # Prompts ## PRM01="\nInstallation of MultiView Mascot\n================================\n" PRM02="\nMultiView Mascot User License upgrade\n=====================================\n" PRM03="\nDo you wish to try again \c" PRM04=", or d for a demo copy\c" PRM05="completed successfully." PRM06="\n\nEnter Serial Number\c" PRM07="Enter Activation Key\c" PRM08="Can't find mascot binary - type in the path name\c" PRM09="Can't find mvw_ixsrv binary - type in the path name\c" PRM10="Invalid input " PRM11="\nDo you have any other Activation Keys \c" PRM12=", or q to quit : \c" PRM13="Warning : " PRM14="Checking file permissions\c" PRM15="\nInstallation" PRM16="\nUser License increase" PRM17="\nThere is a readme file containing notes specific \nto this release. Do you wish to read it now \c" PRM18="\nMoving files into place\c" PRM19="\nMascot already installed, saving existing files" PRM20="\nCreating directory structure \c" PRM21="\nConverting the central mascot.rc command file to new format \c" PRM22="\nMascot has been upgraded.\n\nYour original copy has been saved in\c" PRM23="\nYour old command file has been converted to the new format.\nPlease reference the file 'audit.txt' and the section 'Mascot command\nfiles' in chapter 'Mascot Files' in the Configuration Guide for more\ninformation on the new command files. The 'readme' issued with this product\ngives details on how to upgrade other mascot.rc type command files." PRM24="Uncompressing archive ...\c" PRM25="\n\nExtracting files from archive ...\c" CHKYN00=Y CHKYN01=y CHKYN02=N CHKYN03=n CHKYN04=Q CHKYN05=q CHKYN06="(y/n)? \c" CHKYN07=D CHKYN08=d ## ## Internationalisation ends here ## ## # UNIX Tools List ## TOOLSLIST="/bin/cat /bin/chmod /bin/ln /bin/mkdir /bin/mv /bin/pwd /bin/rm \ /usr/bin/awk /usr/bin/cut /bin/ed /bin/find /usr/bin/tar /usr/bin/uncompress \ /bin/grep" ## # ValidateString() # $1 = string to validate # $2 = numeric upper alphanumeric # Note :- upper only checks the First 3 Characters as it's used # for the Prefix _only_ # $3 = length # returns 0 on success # 1 on fail - ie invalid format ## ValidateString() { len=`$ECHO $1 | awk '{ print length($1) }' ` [ "$len" = "$3" ] || return 1 case "$2" in numeric) $ECHO "$1" | grep -v "[0-9]" > /dev/null 2>&1 [ $? -ne 0 ] || return 1 ;; upper) $ECHO "$1" | grep -v "[A-Z]" > /dev/null 2>&1 [ $? -ne 0 ] || return 1 ;; alphanumeric) $ECHO $1 | grep -v "[a-z,A-Z,0-9]" > /dev/null 2>&1 [ $? -ne 0 ] || return 1 ;; esac return 0 } ## # Function : FindBinaries() # # Purpose : looks for the mascot and mvw_ixsrv binaries in # $BINDIR and $CENTRAL/bin. If it can't find them # It prompts the user for the path name # $MAS and $HS are set containing the full pathname # of the binaries # If the binaries are not found in $CENTRAL/bin # then $Upgrade flag is set to TRUE # # Returns : 0 on Success # 1 on Fail ## FindBinaries() { Upgrade=FALSE if [ -x $CENTRAL/init/mascot ] then MAS=$CENTRAL/init/mascot else if [ -x $CENTRAL/tmp/init/mascot ] then MAS=$CENTRAL/init/mascot else if [ -x $BINDIR/mascot ] then MAS=$BINDIR/mascot Upgrade=TRUE else ## can't find mascot binary prompt user for it Found=FALSE while [ $Found = FALSE ] do $ECHO $PRM08 $ECHO $PRM12 MAS=`line` [ -d "$MAS" ] && MAS=$MAS/mascot if [ -x "$MAS" ] then Upgrade=TRUE Found=TRUE else ## check for q or Q [ "$MAS" = "$CHKYN04" -o "$MAS" = "$CHKYN05" ] && return 1 fi done fi fi fi if [ -x $CENTRAL/init/mvw_ixsrv ] then HS=$CENTRAL/init/mvw_ixsrv else if [ -x $CENTRAL/tmp/init/mvw_ixsrv ] then HS=$CENTRAL/init/mvw_ixsrv else if [ -x $BINDIR/mvw_ixsrv ] then HS=$BINDIR/mvw_ixsrv Upgrade=TRUE else ## can't find mvw_ixsrv binary prompt user for it Found=FALSE while [ $Found = FALSE ] do $ECHO $PRM09 $ECHO $PRM12 HS=`line` [ -d "$HS" ] && HS=$HS/mvw_ixsrv if [ -x "$HS" ] then Upgrade=TRUE Found=TRUE else ## check for q or Q [ "$HS" = $CHKYN04 -o "$HS" = $CHKYN05 ] && return 1 fi done fi fi fi return 0 } ## # Function : GetSerialNumber() # Purpose : Prompts user for Serial Number and activation key # if input = "q" exit on user request # Arguments : None # Returns : 0 on Success # 1 on Fail # 2 if demo copy required # ## GetSerialNumber() { Done=FALSE while [ $Done != TRUE ] do InvalidInput=FALSE SerialNumber= while [ -z "$SerialNumber" ] do $ECHO $PRM06 if [ $Upgrade = FALSE ] then $ECHO $PRM04 # or c to continue fi $ECHO $PRM12 SerialNumber=`line` done if [ $Upgrade = FALSE ] then # look for user typing c to continue if [ "$SerialNumber" = "$CHKYN07" -o "$SerialNumber" = "$CHKYN08" ] then return 2 fi fi # look for user typing c to continue [ "$SerialNumber" = $CHKYN04 -o "$SerialNumber" = $CHKYN05 ] && return 1 ActivationKey= while [ -z "$ActivationKey" ] do $ECHO $PRM07 $ECHO $PRM12 ActivationKey=`line` done [ "$ActivationKey" = $CHKYN04 -o "$ActivationKey" = $CHKYN05 ] && return 1 ## ## validate the user input - If its an upgrade and we already have ## a serial number we don't need to validate it again ## len=`$ECHO $SerialNumber | awk '{ print length($1) }' ` if [ "$len" -eq 9 ] then Prefix=`$ECHO $SerialNumber | cut -c1-3 ` Number=`$ECHO $SerialNumber | cut -c4-9 ` ValidateString $Prefix upper 3 || InvalidInput=TRUE ValidateString $Number numeric 6 || InvalidInput=TRUE else InvalidInput=TRUE fi ValidateString "$ActivationKey" alphanumeric 8 || InvalidInput=TRUE if [ $InvalidInput = FALSE ] then Done=TRUE else $ECHO $PRM10 fi done return 0 } ## # check() - serialise Mascot ## check() { HSS=FALSE Finished=FALSE while [ $Finished = FALSE ] do if [ $AUTOBRAND = TRUE ] then if [ $NEWKEY = FALSE ] then Finished=TRUE fi else GetSerialNumber Returned=$? if [ $Returned -eq 1 ] then infail "$ERR13" fi if [ $Returned -eq 2 ] then ## this is a test drive pack Finished=TRUE Prefix=$DEMOPREFIX Number=$DEMONUMBER ActivationKey=$DEMOKEY fi fi if [ $Upgrade = FALSE ] then SaveMvw MoveNew Saved=TRUE fi cd $CENTRAL/init if [ $AUTOBRAND = TRUE -a $NEWKEY = TRUE ] then Returned=0 else ./mvw.check -M$MAS -H$HS -p$Prefix -s$Number -a$ActivationKey > /dev/null 2>&1 Returned=$? fi case $Returned in 1) if [ $Finished = TRUE ] then infail "$BRAND01" else $ECHO $BRAND01 ## invalid sequence $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 2) if [ $Finished = TRUE ] then infail "$BRAND02" else $ECHO $BRAND02 ## incorrect format $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 3) if [ $Finished = TRUE ] then infail "$BRAND03" else $ECHO $BRAND03 ## can't upgrade with this SN $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 4) if [ $Finished = TRUE ] then infail "$BRAND03" else $ECHO $BRAND03 ## invalid upgrade path $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 6) if [ $Finished = TRUE ] then infail "$BRAND06" else $ECHO $BRAND06 ## invalid argument $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 7) if [ $Finished = TRUE ] then infail "$BRAND07" else $ECHO $BRAND07 ## failed to access mascot $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 8) if [ $Finished = TRUE ] then infail "$BRAND08" else $ECHO $BRAND08 ## failed to access mvw_ixsrv $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 9) if [ $Finished = TRUE ] then infail "$BRAND09" else $ECHO $BRAND09 ## failed to open binary $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 10) if [ $Finished = TRUE ] then infail "$BRAND10" else $ECHO $BRAND10 ## failed to write stamparea $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 11) if [ $Finished = TRUE ] then infail "$BRAND11" else $ECHO $BRAND11 ## failed to find stamparea $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 12) if [ $Finished = TRUE ] then infail "$BRAND12" else $ECHO $BRAND12 ## failed to read stamparea $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 13) if [ $Finished = TRUE ] then infail "$BRAND13" else $ECHO $BRAND13 ## internal error $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 14) if [ $Finished = TRUE ] then infail "$BRAND14" else $ECHO $BRAND14 ## Text file busy $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 15) if [ $Finished = TRUE ] then infail "$BRAND15" else $ECHO $BRAND15 ## Wrong Binary $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 16) if [ $Finished = TRUE ] then infail "$BRAND16" else $ECHO $BRAND16 ## internal error (personality 2) $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 17) if [ $Finished = TRUE ] then infail "$BRAND17" else $ECHO $BRAND17 ## access license file $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 18) infail "$BRAND18" ;; ## corrupt license file 19) if [ $Finished = TRUE ] then infail "$BRAND04" else $ECHO $BRAND04 ## duplicate key $ECHO $PRM03 chkyn || infail "$ERR13" fi ;; 0) if [ $Finished = FALSE ] then $ECHO $BRAND00 ## SN OK $ECHO $PRM11 chkyn || Finished=TRUE; AUTOBRAND=FALSE fi ;; esac done if [ $AUTOBRAND = TRUE -a $NEWKEY = FALSE ] then return fi if [ $Upgrade = FALSE ] then $ECHO "\n$PRM18 \c" $ECHO ".\c" mv mascot $BINDIR || infail "$ERR11" MAS=$BINDIR/mascot $ECHO ".\c" mv mvw_ixsrv $BINDIR || infail "$ERR12" HS=$BINDIR/mvw_ixsrv fi chmod 4755 $MAS || infail "$ERR15" $MAS $ECHO ".\c" chmod 4755 $HS || infail "$ERR15" $HS cd $HOMEDIR $ECHO ".\c" } ## # chkyn() - Get yes or no answer ## chkyn() { while : do $ECHO $CHKYN06 read reply case $reply in $CHKYN00*|$CHKYN01*) return 0 ;; $CHKYN02*|$CHKYN03*) return 1 ;; esac done } ## # infail() - report error and exit ## infail() { if [ $Upgrade = FALSE ] then $ECHO "\n\n$PRM15 $ERR02\n" else $ECHO "\n\n$PRM16 $ERR02\n" fi $ECHO $1 $2 if [ $Upgrade = FALSE ] then $ECHO "$PRM15 $ERR03" else $ECHO "$PRM16 $ERR03" fi ## if script in the middle of autobrand when error occured put original ## license file back so when rerun will try to autobrand again if [ -n "$CENTRAL" ] then if [ -r $CENTRAL/init/License.auto ] then mv $CENTRAL/init/License.auto $CENTRAL/init/License fi fi exit 1 } ## # start_up() - Start Up message ## start_up() { if [ $SCRIPTNAME = "mvw.license" ] then Upgrade=TRUE $ECHO $PRM02 $ECHO $LIC01 chkyn if [ $? -eq 1 ] then exit 0 fi ## its a user license increase and we need to find the central directory ## first test for $MVWDIR environment variable CENTRAL= if [ -n "$MVWDIR" -a -d "$MVWDIR" ] then CENTRAL=$MVWDIR else ## then test for $DEFAULTCENTRAL variable at head of this file if [ -n "$DEFAULTCENTRAL" -a -d "$DEFAULTCENTRAL" ] then CENTRAL=$DEFAULTCENTRAL else ## if not present ask the user Found=FALSE while [ $Found = FALSE ] do CENTRAL= while [ -z "$CENTRAL" ] do $ECHO $LIC02 $ECHO $PRM12 CENTRAL=`line` done if [ -d "$CENTRAL" ] then Found=TRUE else ## check for q or Q [ $CENTRAL = $CHKYN04 -o $CENTRAL = $CHKYN05 ] && return 1 fi done fi fi else Upgrade=FALSE MVWDIR=$CENTRAL export MVWDIR $ECHO $PRM01 fi Saved=FALSE } ## # UpgradedVersion() - If mascot.rc is converted, tell installer. ## UpgradedVersion() { [ -z "$SAVEVERSION" ] && return $ECHO $PRM22 $ECHO " : $HOMEDIR/mvw.$SAVEVERSION and\n$BINDIR/mascot.$SAVEVERSION, etc" if [ -s $CENTRAL/audit.txt ] then $ECHO $PRM23 fi } ## # unix_tools() - Ensure UNIX utilites are available. ## unix_tools() { for tool in `$ECHO $TOOLSLIST` do if [ "$tool" = "/usr/bin/tar" ] then # if /bin/tar exists then ok to go on to next [ -x /bin/tar ] && continue fi [ -x $tool ] || infail "$ERR01" $tool done } ## # SuCheck() - returns 0 if running root ( Super-user ) # 1 if not ## SuCheck() { cd /tmp TMP=mascot.$$ cat /dev/null > $TMP FIND=`find . -user 0 -name $TMP -print 2>/dev/null` rm -f $TMP if [ "$FIND" != ./$TMP ] then infail "$BRAND05" fi cd $HOMEDIR } ## # checkbranded() - check for already install licenses # file is read in on standard input and each line is set # into the environment where # $1 is the prefix # $2 is the serial number # $3 is the activation key # $6 is the no. of users ## checkbranded() { list=`line` while [ -n "$list" ] do set `$ECHO "$list"` if [ $2 != "999999" ] then Prefix=$1 Number=$2 ActivationKey=$3 AUTOBRAND=TRUE $ECHO $BRAND20$Prefix$Number$BRAND21$ActivationKey check fi list=`line` if [ -n "$list" ] then $ECHO fi done } ## # checkpermissions() - Ensure file permissions and ownerships # file is read in on standard input and each line is set # into the environment where # $1 is the owner # $2 is the group # $3 is the permissions # $4 is the filename ## checkpermissions() { cd $CENTRAL $ECHO "\n$PRM14 \c" list=`line` while [ -n "$list" ] do $ECHO ".\c" set `$ECHO "$list"` FirstChar=`$ECHO $1 | cut -c1 ` if [ $FirstChar != "#" ] ## its a comment then if [ -f "$4" -o -d "$4" ] then chmod $3 $4 || $ECHO $PRM13 $ERR15 $4 chown $1 $4 || $ECHO $PRM13 $ERR09 $4 chgrp $2 $4 || $ECHO $PRM13 $ERR10 $4 else $ECHO "\n$PRM13 $ERR08 $4" fi fi list=`line` done } ## # CompileMaps(): compiles all of the language mapping files in # $CENTRAL/map directories ## CompileMaps() { if [ ! -z "$MVWDIR" ] then OLDMVWDIR=$MVWDIR fi MVWDIR=$CENTRAL export MVWDIR cd $CENTRAL/map for i in * do if [ -d $i ] then cd $i for j in * do if [ ! -d $j ] then NAME=`$ECHO $j | awk 'BEGIN { FS = "." } { print $1 }'` $CENTRAL/bin/mvw.mapcomp -t$i -m$NAME $ECHO ".\c" fi done cd .. fi done if [ ! -z "$OLDMVWDIR" ] then MVWDIR=$OLDMVWDIR export MVWDIR fi } ## # do_links() - if it's a fresh installation link relevent files # compile the language mapping files in the map directory # and go away and set file permissions defined in # init/list, the permissions list. ## do_links() { if [ $Upgrade = FALSE ] then CompileMaps $ECHO ".\n" if [ $CHECK_PERMS = TRUE ] then chmod 777 $CENTRAL chown root $CENTRAL chgrp 1 $CENTRAL if [ -f $CENTRAL/init/list ] then chmod 400 $CENTRAL/init/list cat $CENTRAL/init/list | checkpermissions fi fi fi } ## # page_readme() - page the readme file if requested by user ## page_readme() { if [ -s $CENTRAL/$README ] then chmod 444 $CENTRAL/$README $ECHO "$PRM17" ## do yo want to see the readme file chkyn ## y/n if [ $? -eq 0 ] then cat $CENTRAL/$README | $PAGER ## page the readme file $ECHO "$PRM15 $PRM05" ## Installation successful fi fi } ## # For SCO UNIX - check the release level and move the correct mvw_ptys # file into place. This is required because the naming of pseudo-ttys # was different prior to 3.2.4 ## PtyCheck() { if [ -f /etc/perms/rts ] then Release=`grep "^#rel=" /etc/perms/rts` if [ $? = 0 ] then Release=`$ECHO $Release | cut -c6-10` case $Release in 3.2.[0-3] ) mv $CENTRAL/mvw_ptys.old $CENTRAL/mvw_ptys > /dev/null 2>&1 ;; * ) ;; esac fi if [ -f $CENTRAL/mvw_ptys.old ] then rm $CENTRAL/mvw_ptys.old > /dev/null 2>&1 fi fi } ## # SaveMvw() - Check to see if a previous version of Mascot is # already installed that we can upgrade over, if so save $CENTRAL. ## SaveMvw() { if [ $Saved = FALSE ] then if [ -s mvw/init/.mvw_version ] ## Mascot Version 4 ? then SAVEVERSION=`cat mvw/init/.mvw_version` else if [ -s mvw/init/License ] ## Mascot Version 3.3 ? then SAVEVERSION=33 else if [ -d mvw/bin ] ## Mascot Version 3.2 or below ? then SAVEVERSION=32 fi fi fi [ -z "$SAVEVERSION" ] && return $ECHO $PRM19 mkdir mvw.$SAVEVERSION [ $? -ne 0 ] && infail "$ERR16" cd mvw find . -print | cpio -dlp ../mvw.$SAVEVERSION 2>/dev/null [ $? -ne 0 ] && infail "$ERR16" rm -rf data mvw- rm -f bin/mvw_* bin/mvw.clock mvw_ansi mvw_vt100 *.rc cd .. rm -r mvw.$SAVEVERSION/tmp rm mvw.$SAVEVERSION/install ln mvw.$SAVEVERSION/bin/mvw.license mvw.$SAVEVERSION/install [ -x $BINDIR/mascot ] && mv $BINDIR/mascot $BINDIR/mascot.$SAVEVERSION [ -x $BINDIR/mvw_ixsrv ] && mv $BINDIR/mvw_ixsrv $BINDIR/mvw_ixsrv.$SAVEVERSION [ -x $BINDIR/mview ] && mv $BINDIR/mview $BINDIR/mview.$SAVEVERSION $ECHO fi } ## # MoveNew() - move the files from tmp/ into MVWDIR. This ensures we # can save any existing files on a version upgrade. If IBM AIX RS6000, # move AIX v3 or v4 mascot into place as appropriate. ## MoveNew() { if [ $Saved = FALSE ] then $ECHO $PRM20 cd mvw/tmp [ $? -ne 0 ] && infail "$ERR01" mvw/tmp find . -print | cpio -dpl ../ 2>/dev/null [ $? -ne 0 ] && infail "$ERR16" cd .. rm -r tmp $ECHO if [ -n "$SAVEVERSION" ] && [ "$SAVEVERSION" != "32" ] && [ -s ../mvw."$SAVEVERSION"/mascot.rc ] then $ECHO $PRM21 cp ../mvw.$SAVEVERSION/mascot.rc . cp .mvw_usermenu .mvw_usermenu- bin/mvw.convert mascot.rc > audit.txt 2>&1 [ $? -ne 0 ] && $ECHO "$ERR17" rm mascot.rc $ECHO fi cd .. fi } ## # autobrand() - automatically reserialize a new product ## autobrand() { if [ $Upgrade = TRUE ] then return fi if [ ! -r $CENTRAL/init/License ] then return fi echo $BRAND19 mv $CENTRAL/init/License $CENTRAL/init/License.auto checkbranded < $CENTRAL/init/License.auto rm $CENTRAL/init/License.auto } ## # ExpandFiles() - if files are downloaded from the media they are held # in compressed tar format. This will uncompress the Z file and extract # the tar files into the tmp/ within MVWDIR. ## ExpandFiles() { if [ $Upgrade = TRUE ] || [ ! -s $CENTRAL/$EXPANDFILE ] then return fi $ECHO $PRM24 uncompress $CENTRAL/$EXPANDFILE 2>&1 > /dev/null [ $? -ne 0 ] && infail "$ERR18" if [ ! -s $CENTRAL/$TARFILE ] then infail "$ERR08" $TARFILE fi $ECHO $PRM25 cd $CENTRAL tar xf $CENTRAL/$TARFILE 2>&1 > /dev/null [ $? -ne 0 ] && infail "$ERR18" cd $HOMEDIR rm -f $CENTRAL/$TARFILE } ## # main() ## ## # Catch any efforts to abort ## trap 'infail "$ERR14"' 1 2 4 9 15 SCRIPTNAME=`basename $0` ## # initialisation messages ## start_up if [ $SCRIPTNAME = "install" ] then if [ ! -x $CENTRAL/$SCRIPTNAME ] then infail "$ERR07" ## wrong directory - check installation notes fi fi ## # check you're Super-User ## SuCheck ## # check that we have all the required utilities ## unix_tools ## # uncompress the files and create the tmp/ directory ## ExpandFiles || infail "$ERRxx" ## # locate the mascot and mvw_ixsrv executables. # if they are in the init directory we can assume that this is # a fresh installation - else we must assume the user is wishing # to increase the user license. ## FindBinaries || infail "$ERR13" autobrand ## # Prompt for Serial Number / Activation keys. # Validate them and then brand the binaries. ## NEWKEY=TRUE check || infail "$ERR04" ## # For SCO UNIX - check the release level and move the correct mvw_ptys # file into place ## if [ $Upgrade = FALSE ] then PtyCheck fi ## # if it's a fresh installation carry out links and check permissions # with the Permissions list, init/list. ## do_links ## # Create the User license upgrade script if not already present ## if [ ! -x "$CENTRAL/bin/mvw.license" ] then ln $CENTRAL/install $CENTRAL/bin/mvw.license > /dev/null 2>&1 fi if [ $Upgrade = FALSE ] then $ECHO "$PRM15 $PRM05" ## Installation successful page_readme else $ECHO "$PRM16 $PRM05" ## User License increase successful fi UpgradedVersion exit 0