#!/bin/sh PATH=/usr/ucb:/bin:/usr/bin:/etc:/usr/etc export PATH # # # clean up and go away # cleanup () { exit $1 } # echo " KnowledgeMan " echo " Version 3.00" echo echo " Micro Data Base Systems, Inc. (mdbs, Inc.)" echo " Copyright (c) 1986, 1990 Micro Data Base Systems, Inc." echo " All rights reserved." echo echo " KnowledgeMan is a registered trademark of Micro Data Base Systems, Inc." echo echo " This script will install KnowledgeMan Version 3.00 on your computer system." echo echo " This script uses the tar (1) utility to copy all KnowledgeMan files from " echo " the distribution media to your chosen directory. It also creates a" echo " sub-directory structure containing the various KnowledgeMan modules." echo echo " Everyone who runs KnowledgeMan must first set their PATH to include the " echo " directory where KnowledgeMan is installed. The installation script can " echo " automatically inform all potential KnowledgeMan users of the correct PATH" echo " setting. To do this, you must first create a text file containing a list " echo " of the users' login names with one name on each line. If you wish to use " echo " this feature, you will be prompted during the installation for the name of" echo " this file." echo # echo -n "Do you wish to continue [ y | n ] ?" read ctnue echo if [ "X$ctnue" = "Xn" ] then cleanup 1 fi # bool=0 while [ $bool -eq 0 ] do echo "Enter the destination directory for KnowledgeMan " echo "or \".\" for the current directory:" read kmandir if [ "X$kmandir" != "X" ] then bool=1 fi done # if [ $kmandir = "." ] then kmandir=`pwd` fi kmanbindir="${kmandir}/kman/bin" kmanhomedir="${kmandir}/kman" echo # # Mail Notification # echo "The installation script is ready to send a mail message to all potential " echo "KnowledgeMan users informing them of the correct PATH setting to access " echo "KnowledgeMan. " echo echo -n "Do you wish to inform the users of the PATH to KnowledgeMan [ y | n ] ?" read automail echo if [ "X$automail" = "X" -o "X$automail" = "Xy" ] then bool=0 while [ $bool -eq 0 ] do echo -n "User list filename : " read userlist if [ "X$userlist" != "X" ] then bool=1 fi done for username in `cat $userlist` do echo "Sending Mail notification to:" echo $username echo "KnowledgeMan is now installed on your system in the directory $kmanbindir To use KnowledgeMan, edit the PATH statement in your .login file to include $kmanbindir : for example, if your PATH statement looks like: set path = (. /usr/ucb /bin /usr/bin) alter it to read set path = (. /usr/ucb /bin /usr/bin $kmanbindir ) The Environment variable KMANHOME also needs to be set to $kmanhomedir to do this you should also add to your .login the statement: setenv KMANHOME $kmanhomedir After you have edited .login, enter the command source .login to set KMANHOME and to execute the new path statement. To start KnowledgeMan on a workstation in sunview environment, enter kmanstool in openwin environment, enter kmanxtool To start KnowledgeMan on a terminal, enter kman " | /usr/ucb/mail -s "KnowledgeMan Installation Information" $username done echo fi # bool=0 while [ $bool -eq 0 ] do echo -n "Is the media drive local or remote [ l | r ] ?" read tapeloc if [ "X$tapeloc" = "Xl" -o "X$tapeloc" = "Xr" ] then bool=1 fi done # if [ $tapeloc = "r" ] then tape_host="" while [ "$tape_host" = "" ] do echo -n "Name of remote host : " read tape_host # Test to see if remote host responds rsh -n $tape_host "echo 0 > /dev/null" if [ "$?" -ne 0 ] then echo "Problem with reaching remote host $tape_host" tape_host="" fi done fi echo # devname="" DISK=0 while [ "$devname" = "" ] do echo echo -n "Enter Device Name (e.g. rst0, rmt0, rfd0c, rfd0g) : /dev/r" read devname case "$devname" in st*) OPTIONS="xvfbp" BS=20 ;; mt*) OPTIONS="xvfbp" BS=20 ;; fd*) if [ $tapeloc = "r" ] then echo "Remote option cannot be used with diskette installation" devname="" fi OPTIONS="xvfbp" BS="20" DISK=1 ;; ar*) OPTIONS="xvfbp" BS=126;; *) echo "Invalid device name $devname" devname="" ;; esac done # echo " Please mount the release tape if you haven't done so already. " echo -n "Do you wish to continue [ y | n ] ?" read ctnue if [ "X$ctnue" = "Xn" ] then cleanup 1 fi echo # DD="$TEST dd" MT="$TEST mt" TAR="$TEST tar" BAR="$TEST bar" if [ $DISK -eq 0 ] then DEVPATH="/dev/nr${devname}" else DEVPATH="/dev/r${devname}" fi cd $kmandir if [ $tapeloc = "l" ] then if [ $DISK -eq 0 ] then $MT -f ${DEVPATH} rew if [ "$?" -ne 0 ] then echo echo "Error in Extracting Software. Check Tape." cleanup 1 fi echo "Extracting software... " $TAR $OPTIONS $DEVPATH $BS kman if [ "$?" -ne 0 ] then echo "Error in Extracting Software. Check Tape." $MT -f $DEVPATH rewind cleanup 1 else echo "Software installation complete." fi else # This is where the multiple disk handling should go. $TAR ${OPTIONS} ${DEVPATH} ${BS} kman if [ "$?" -ne 0 ] then echo echo "Error in Extracting Software. Check the media." cleanup 1 fi # echo " Please remove Disk #1 and insert Disk #2 in the floppy drive. " eject echo -n "Do you wish to continue [ y | n ] ?" read ctnue if [ "X$ctnue" = "Xn" ] then cleanup 1 fi echo # $TAR ${OPTIONS} ${DEVPATH} ${BS} kman if [ "$?" -ne 0 ] then echo echo "Error in Extracting Software. Check the media." cleanup 1 fi # echo " Please remove Disk #2 and insert Disk #3 in the floppy drive. " eject echo -n "Do you wish to continue [ y | n ] ?" read ctnue if [ "X$ctnue" = "Xn" ] then cleanup 1 fi echo # $TAR ${OPTIONS} ${DEVPATH} ${BS} kman if [ "$?" -ne 0 ] then echo echo "Error in Extracting Software. Check the media." cleanup 1 fi echo " Please remove Disk #3 from floppy drive. " eject # At this point we are going to uncompress all the files. echo " Decompressing files, please wait. " find $kmandir -name "*.Z" -exec uncompress {} \; echo " Decompression complete. " fi echo else stat="" stat=`rsh ${tape_host} "$MT -f ${DEVPATH} rew; echo \\$status"` case $stat in [1-9]* | 1[0-9]* ) echo echo "Error in Extracting Software. Check Tape." cleanup 1 ;; *) continue ;; esac echo "Extracting software... " rsh $tape_host $DD if=$DEVPATH bs=${BS}b | ${TAR} xBvfb - ${BS} kman if [ "$?" -ne 0 ] then echo "Error in Extracting Software. Check Tape." cleanup 1 else echo "Software installation complete." fi echo fi