#!/bin/csh -f
# install_script_template * installation script for Liken 2.0
#	(C) Copyright 1993 by ANDATACO
# MODIFICATION HISTORY
#  Tue Nov 30 17:00:00 1993  submitted by henry
#     Use revision 2.0 for license manager key verification.
#
umask 0

##################################################
#   PARAMETER AND DEFAULT SETTINGS:
##################################################

set MINFREE = 30000
set DEF_LIKEN = /usr/Liken
set MANDIR = /usr/Liken/manpages
set LDIRNAME = licenses
set LFILENAME = license.dat
set INTERACT = 1
set EXECUTE = 0
set INSTALLDIR = `pwd`

set LIKENDIR = $DEF_LIKEN
set LICENSEDIR = $LIKENDIR/$LDIRNAME
set LICENSEFILE = $LICENSEDIR/$LFILENAME
set LICHIDCMD = "/tmp/hpea"
set SERVERS = ( host1 host2 )
set SERVERIDS = ( id1 id2 )
set FEATURE_LINE = (feature1 feature2 )
set FEATURES_EXIST = 0
set FEATURES = ""

set XSID = xsid 
set LMGRD = lmgrd

set XSIDPATH = $LICENSEDIR/$XSID 
set LMGRDPATH = $LICENSEDIR/$LMGRD

set ENVVAR = LM_LICENSE_FILE

set LIKENVER = "Liken 2.0"
set LIKENDATE = "06-nov-53"
set REL = 2.000
set VSTRING = " "
set XSIPHONE = "(800) 443-9191"

set XTRCT = "tar -xvf"
set EXTRACT_MANUAL = 0
set REMOTESRC = ""
set USINGFD = 1
set FD1NAMES = "licenses top disks net"
set FD2NAMES = "licenses top manpages net"

set RUSRNAME = 0
set path = (/usr/ucb $path /bin /usr/etc /etc)

set HOST = `uname -s`
if ( $HOST == SunOS ) then
	set HOST = Sun
else if ( $HOST == HP-UX ) then
	set HOST = HP
else if ( $HOST == AIX ) then
	set HOST = IBM
else 
	echo " "
	echo "This host operating system is named $HOST"
	echo " "
	echo "This is not one of the standard supported systems,"
	echo "which must be SunOS, HP-UX, or AIX"
	echo " "
	echo "Please contact customer support for assistance"
	exit
#    If you can fix this, edit the next line and delete the exit above
	set HOST = correct
endif

if ( $HOST == Sun ) then
	set RSH = "rsh"
	set LICHOST = "Sun"
	set DEF_BOOTDEV = /dev/fd0
	set RCFILE = "/etc/rc.local"
	set DF = "df"
else if ( $HOST == HP ) then
	set RSH = "remsh"
	set LICHOST = "HP 700"
	set DEF_BOOTDEV = /dev/dsk/0s0
	set RCFILE = "localrc function in the /etc/rc"
	set DF = "bdf"
else
	set RSH = "remsh"
	set LICHOST = "IBM RS6000"
	set DEF_BOOTDEV = /dev/fd0
	set RCFILE = "localrc function in the /etc/rc"
	set DF = "df -I"
endif
set BOOTDEV = $DEF_BOOTDEV

umask 0

##################################################
#   BEGIN SCRIPT
##################################################

if ( $#argv == 1 && $EXECUTE == 0 ) then
	echo    "**********************************************************"
	echo    "As you requested by clicking the 'WriteScript' button,"
	echo    "   the install script will NOT be executed at this time."
	echo -n "    It has been written to "
	echo `pwd`/install_script
	echo -n "To execute install_script, cd "
	echo `pwd`
	echo    "   and invoke it without an argument as 'install_script'"
	echo    "**********************************************************"
	exit
endif
echo "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>"
echo ""
echo "$LIKENVER installation script"
echo "   Copyright (C) 1993 ANDATACO"
echo ""
echo "<> This script will configure and install your $LIKENVER release,"
echo "   and start the floating license daemon for the first time."
echo "<> You may wish to add the daemon startup to your"
echo "   $RCFILE file"
echo "   so that the daemon will automatically start at reboot"
echo ""
if ( $INTERACT == 1 ) then
	echo "<> Default values will be displayed in brackets eg. [default]."
	echo "   To select the default answer to any question, type a <CR>"
	echo ""
endif
echo "<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>"

set a = `whoami`
if ( $a == "root" ) then
	echo ""
	echo "**********************************************************"
	echo "  You do not need to run the install as 'root'."
	echo "  If you continue as 'root', and a license server is to be"
	echo "     started on a remote host, the '$RSH' command will be used."
	echo "  Note that this may require that you NFS mount the Liken"
	echo "     directory."
	echo "**********************************************************"
	echo ""
	echo -n "Continue running as root anyway? [n]: "
	set tmp = ($<)
	if ("$tmp" == "" || $tmp =~ [nN]* ) then
		exit
	endif
endif

if ( $RUSRNAME == 0 ) then
	echo -n "Enter a username which can '$RSH' the hosts you will be installing on:"
	set RUSRNAME = ($<)
endif

if ( $INTERACT == 1 ) then
lkdir:
	set LIKENDIR = $DEF_LIKEN
	set LICENSEDIR = $LIKENDIR/$LDIRNAME
	set LICENSEFILE = $LICENSEDIR/$LFILENAME
	set XSIDPATH = $LICENSEDIR/$XSID 
	set LMGRDPATH = $LICENSEDIR/$LMGRD
	echo ""
	echo -n "Please enter the directory path for Liken [$LIKENDIR]: "
	set tmp = ($<)
	if ("$tmp" != "") then
		echo $tmp | grep "^/" >& /dev/null
		if ($status != 0) then
			echo "Pathname cannot be relative (it must begin with /)"
			goto lkdir
		endif
		set LIKENDIR = $tmp
		set LICENSEDIR = $LIKENDIR/licenses
		set LICENSEFILE = $LICENSEDIR/$LFILENAME
		set XSIDPATH = $LICENSEDIR/$XSID 
		set LMGRDPATH = $LICENSEDIR/$LMGRD
	endif
endif
if ( -e $LIKENDIR ) then
	if ( $INTERACT == 1 ) then
		echo    "The Liken directory, ${LIKENDIR}, exists.  Have you"
		echo -n "  backed up everything of value in that directory? [n]: "
		set tmp = ($<)
		if ( $tmp !~ [yY]* ) then
			echo -n "Do you wish to choose another Liken directory? [y]: "
			set tmp = ($<)
			if ( $tmp =~ [yY]* ) then
				goto lkdir
			else
				echo "You have chosen to retain your current Liken directory"
				echo "  contents and have provided no alternative directory.  If"
				echo "  you wish to install Liken you may..."
				echo "Use the command:"
				echo "      % install_script restart"
				echo "  to restart this installation script"
				echo "OR the commands:"
				echo "      % install_liken"
				echo "      % install_script go"
				echo "  to rebuild the installation script"
				echo "  and execute it."
				exit
			endif
		endif
	endif
else
	mkdir $LIKENDIR
	if ($status != 0) then
		echo Error making directory $LIKENDIR
		goto lkdir
	endif
endif
if ( ! -w $LIKENDIR ) then
	echo Error:  Directory $LIKENDIR is not writeable
	goto lkdir
endif
pushd $LIKENDIR >/dev/null
if ($status != 0) then
	echo Error changing directory to $LIKENDIR
	exit
endif
set dfree = `$DF . | tail -1 | sed -e "s/[^ ]*/1/" | awk '{ print $4 }'`
if ($dfree < $MINFREE ) then
	echo ""
	echo "WARNING: there does not appear to be enough free disk space"
	echo "         on the filesytem containing" $LIKENDIR
	echo "         to successfully install Liken."
	echo "         ($dfree is available, $MINFREE is suggested)"
	echo ""
	echo -n "Continue [n]? "
	set tmp = ($<)
	if ( $tmp !~ [yY]* ) then
		echo " *** INSTALL ABORTED ***"
		exit
	endif	
endif
popd >/dev/null
mv ./XSIdsk1 $LIKENDIR
if ($status != 0) then
	echo Error moving file XSIdsk1 to $LIKENDIR
	exit
endif
mv ./XSIdsk2 $LIKENDIR
if ($status != 0) then
	echo Error moving file XSIdsk2 to $LIKENDIR
	exit
endif
pushd $LIKENDIR >/dev/null

if ( $INTERACT == 1 ) then
	echo ""
	echo -n "Extract Postscript(c) copy of Liken Manual? [n]: "
	set tmp = ($<)
	if ( $tmp =~ [yY]* ) then
		set EXTRACT_MANUAL = 1
	endif	
endif

echo ""
echo "Installing into $LIKENDIR..."
if ( $EXTRACT_MANUAL ) then
	echo "   (...and extracting User Manual...)"
	$XTRCT XSIdsk1 $FD1NAMES manps
else
	$XTRCT XSIdsk1 $FD1NAMES
endif
if ($status != 0) then
	echo Error extracting files from XSIdsk1: $XTRCT failed
	exit
else
	'rm' XSIdsk1
endif
$XTRCT XSIdsk2 $FD2NAMES
if ($status != 0) then
	echo Error extracting files from XSIdsk2: $XTRCT failed
	exit
else
	'rm' XSIdsk2
endif

mv top/* .
rmdir top
if ( $EXTRACT_MANUAL ) then
	mv manps/* .
	rmdir manps
endif

echo ""
echo "Uncompressing distribution files..."
set perline = 0
foreach file ( `find . -name \*.gz -print` )
	@ perline = $perline + 1
	set tail = $file:t
	if( $perline == 5 ) then
		set perline = 0
		echo " " $tail:r
	else
		echo -n " " $tail:r
	endif
uncmp:
	$INSTALLDIR/gunzip $file
	if ( $status ) then
		echo ""
		set perline = 0
		echo -n Uncompress of $file failed. "Try again?[n]: "
		set tmp = ($<)
		if ("$tmp" !~ [yY]* ) then
			echo " *** INSTALL ABORTED ***"
			exit
		endif
		goto uncmp
	endif
end
if( $perline != 0 ) echo ""
echo  "...Uncompress Complete"
echo ""

#
#   Set up hard links for FLEXlm utilities.
#   lmutil --> lmdown, lmhostid, lmreread, & lmstat.
#
ln $LICENSEDIR/lmutil $LICENSEDIR/lmdown
ln $LICENSEDIR/lmutil $LICENSEDIR/lmhostid
ln $LICENSEDIR/lmutil $LICENSEDIR/lmreread
mv $LICENSEDIR/lmutil $LICENSEDIR/lmstat

if ( $INTERACT == 1 ) then
mpage:
	echo ""
	echo -n "Please enter the path for the Liken man pages [$MANDIR]: "
	set tmp = ($<)
	if ("$tmp" != "") then
		set MANDIR = $tmp
	endif
endif
if ( $MANDIR != "" && $MANDIR != $LIKENDIR/manpages ) then
	if (! -e $MANDIR) then
		mkdir $MANDIR
		if ($status != 0) then
			echo Error making directory $MANDIR
			goto mpage
		endif
	endif
	if (-w $MANDIR) then
		cp manpages/* $MANDIR
		if ($status != 0) then
			echo Error copying the man pages to $MANDIR.
			echo The man pages will be left in $LIKENDIR/manpages.
		endif
	else
		echo You do not have write permission to $MANDIR.
		echo ""
		echo -n "Do you want to specify another directory for the man pages? [n]: "
		set tmp = ($<)
		if ("$tmp" != "" && $tmp !~ [nN]* ) then
			goto mpage
		endif
		echo The man pages will be left in $LIKENDIR/manpages.
	endif
endif

if ( $INTERACT == 1 ) then
	echo ""
	echo "Extraction of files is complete."
	echo ""
	echo "We will now create your license file."
	echo ""
	licdir:
	echo ""
	echo    "The license directory must be accessible at the same path"
	echo    "on every node which will run Liken."
	echo -n "Please enter the Liken license directory path [$LICENSEDIR]: "
	set tmp = ($<)
	if ("$tmp" != "") then
		set LICENSEDIR = $tmp
		set LICENSEFILE = $LICENSEDIR/$LFILENAME
		set XSIDPATH = $LICENSEDIR/$XSID 
		set LMGRDPATH = $LICENSEDIR/$LMGRD
	endif
endif
if ( ! -e $LICENSEDIR ) then
	mkdir $LICENSEDIR
	if ($status != 0) then
		echo Error making directory $LICENSEDIR
		goto licdir
	endif
endif
if ( ! -w $LICENSEDIR ) then
	echo Error:  Directory $LICENSEDIR is not writeable
	goto licdir
endif
echo "" >$LICENSEDIR/start.all
echo "" >$LICENSEDIR/servers
if ( $INTERACT == 1 ) then
	echo ""
	echo "A license server is the $LICHOST workstation on which the"
	echo "license manager daemons will run. (one server is all you need)"
@ N = 0
server:
while (1)
	echo ""
	echo -n "Enter hostname for each license server (<CR> when all servers have been entered): "
	set resp = ($<)
else
@ N = 1
while (1)
	if ( $#SERVERS < $N ) break
	set resp = $SERVERS[$N]
endif
	if ("$resp" == "-") continue
	if ("$resp" == "") then
		break
	else
		set SERVERNAME = $resp
		if ( $INTERACT == 1 ) then
			popd >/dev/null
			set SERVERID = `$RSH $SERVERNAME -l $RUSRNAME $LICHIDCMD` 
			pushd $LIKENDIR >/dev/null
sid:
			echo -n "Enter hostid of $SERVERNAME [$SERVERID]: "
			set resp = ($<)
			if ("$resp" != "") then
				echo $resp | grep "[^0-9a-fA-F]" >& /dev/null
				if ($status == 0) then
					echo Please specify the hostid as a hex number without the leading \"0x\"
					goto sid
				endif
				set SERVERID = $resp
			endif
		else
			set SERVERID = $SERVERIDS[$N]
		endif
		@ N++
		echo SERVER $SERVERNAME $SERVERID 1700 		    >>$LICENSEDIR/servers
		set LPATH = $LICENSEFILE
		echo "$RSH $SERVERNAME -l $RUSRNAME $LICENSEDIR/start.$SERVERNAME" >>$LICENSEDIR/start.all
		echo "#\!/bin/csh -f"				     >$LICENSEDIR/start.$SERVERNAME
		echo "setenv $ENVVAR $LPATH" 			    >>$LICENSEDIR/start.$SERVERNAME
		echo "$LMGRDPATH >& $LICENSEDIR/$SERVERNAME.log &"  >>$LICENSEDIR/start.$SERVERNAME
		chmod +x $LICENSEDIR/start.$SERVERNAME
	endif
end
if ( $N == 0 ) then
	echo At least one license server must be given.
	goto server
endif
		cat $LICENSEDIR/servers >$LICENSEFILE
		echo DAEMON $XSID $XSIDPATH >>$LICENSEFILE
if ( $FEATURES_EXIST == 1 ) then
		cat $FEATURES >>$LICENSEFILE
else
if ( $INTERACT == 1 ) then
	echo ""
	echo "Now, call Customer Support at ANDATACO: $XSIPHONE"
	echo "   to obtain the necessary License information."
	echo -n "Press <CR> when ready to continue: "
	set resp = ($<)
endif

@ N = 0
while (1)
	if ( $INTERACT == 1 ) then
		echo ""
any_fixed:
		echo -n "Have you purchased any fixed-node licenses? [n]: "
		set resp = ($<)
		if ( "$resp" != "" && $resp !~ [yYnN]* ) goto any_fixed
		if ( $resp =~ [yY]* ) then
next_fixed:
			echo ""
			echo -n "   Enter hostname on which Liken will run (<CR> to quit): "
			set resp = ($<)
			if ("$resp" == "-") continue
			if ("$resp" == "") then
				break
			else
				@ N++
				set HOSTNAME = $resp
				popd >/dev/null
				set HOSTID = `$RSH $HOSTNAME -l $RUSRNAME $LICHIDCMD` 
				pushd $LIKENDIR >/dev/null
hid:
				echo -n "   Enter hostid of $HOSTNAME [$HOSTID]: "
				set resp = ($<)
				if ("$resp" != "") then
					echo $resp | grep "[^0-9a-fA-F]" >& /dev/null
					if ($status == 0) then
						echo Please specify the hostid as a hex number without the leading \"0x\"
						goto hid
					endif
					set HOSTID = $resp
				endif
must:
				echo -n "   Enter Key (obtained from calling ANDATACO): "
				set resp = ($<)
				if ("$resp" == "") then
					goto must
				endif
				set KEY = $resp
				set VSTRING = "Welcome to $LIKENVER\nFixed node license"
				echo -n "   Enter TAG (from ANDATACO): "
				set resp = ($<)
				if ("$resp" != "") then
					set VSTRING = "$resp"
				endif
				echo FEATURE Liken.$HOSTID $XSID $REL $LIKENDATE 1 $KEY \"$VSTRING\" >>$LICENSEFILE
				goto next_fixed
			endif
		else
			break
		endif
	else
		@ N++
		if ( $#FEATURE_LINE < $N ) break
		if ("$FEATURE_LINE[$N]" == "") then
			break
		else
			echo $FEATURE_LINE[$N] >>$LICENSEFILE
		endif
	endif
end

if ( $INTERACT == 1 ) then
any_floats:
	echo ""
	echo -n "Have you purchased any floating licenses? [n]: "
	set resp = ($<)
	if ("$resp" != "" && $resp !~ [yYnN]* ) goto any_floats
	if ($resp =~ [yY]* ) then
must1:
		echo -n "   Enter Number of floaters (obtained from ANDATACO): "
		@ NUM = ($<)
		if ($NUM == 0) then
			goto must1
		endif
must2:
		echo -n "   Enter Key (obtained from calling ANDATACO): "
		set resp = ($<)
		if ("$resp" == "") then
			goto must2
		endif
		set KEY = $resp
		set VSTRING = "Welcome to $LIKENVER\nFloating license"
		echo -n "   Enter TAG (from ANDATACO): "
		set resp = ($<)
		if ("$resp" != "") then
			set VSTRING = "$resp"
		endif
		echo FEATURE Liken $XSID $REL $LIKENDATE $NUM $KEY \"$VSTRING\" >>$LICENSEFILE
	endif
endif

if ( "$LICENSEDIR" != "$LIKENDIR/licenses" ) then
	mv $LIKENDIR/licenses/* $LICENSEDIR
endif

if ( $INTERACT == 1 ) then
	echo ""
	echo "Writing Liken_defaults file to $LIKENDIR"
	if ( "$LIKENDIR" != "/usr/Liken" ) then
		echo liken.AllHosts.likenDir: $LIKENDIR  >>$LIKENDIR/Liken_defaults
		echo liken.AllHosts.keyboardmap: $LIKENDIR/keyboardmap >>$LIKENDIR/Liken_defaults
		echo liken.AllHosts.diskSearchPath: $LIKENDIR/disks >>$LIKENDIR/Liken_defaults
	endif
	if ( "$LICENSEDIR" != "/usr/Liken/licenses" ) then
		echo liken.AllHosts.licensefile: $LPATH >>$LIKENDIR/Liken_defaults
	endif
else
	popd >/dev/null
	if ( -f Liken_defaults ) then
		cp Liken_defaults $LIKENDIR/Liken_defaults
	endif
	pushd $LIKENDIR >/dev/null
endif
echo "liken.AllHosts.licensefile:	$LPATH" >> $LIKENDIR/Liken_defaults 	

#
#   Set up the AppleTalk world
# 

'rm' -f $LIKENDIR/net/setup $LIKENDIR/net/init-atalk

echo "#\!/bin/sh"                           > $LIKENDIR/net/init-atalk
echo "LM_LICENSE_FILE=$LICENSEFILE"        >> $LIKENDIR/net/init-atalk
echo "export LM_LICENSE_FILE"              >> $LIKENDIR/net/init-atalk
echo "$LIKENDIR/net/appletalkd" '$*'       >> $LIKENDIR/net/init-atalk
echo 'exit $?'                             >> $LIKENDIR/net/init-atalk
chmod 0555 $LIKENDIR/net/init-atalk

umask 0
 
echo '#\!/bin/csh -f'                         > $LIKENDIR/net/setup
echo 'set path = (/usr/ucb $path /bin /usr/etc /etc)' >> $LIKENDIR/net/setup
echo "chown root $LIKENDIR/net/appletalkd"   >> $LIKENDIR/net/setup
echo 'if ($status != 0) exit $status'        >> $LIKENDIR/net/setup
echo "chmod 4755 $LIKENDIR/net/appletalkd"   >> $LIKENDIR/net/setup
echo 'if ($status != 0) exit $status'        >> $LIKENDIR/net/setup

echo ""
echo -n "Do you want to install networking option? [y] "
set resp = ($<)
if ( "$resp" == "" || $resp =~ [yY]* ) then
netagain1:
	echo "liken.AllHosts.doNetworking:	True" >> $LIKENDIR/Liken_defaults
	if ( $status ) then
		echo " "
		echo "Error updating defaults file with network options:"
		echo "  Could not write to $LIKENDIR/Liken_defaults"
		echo "    Check permissions"
		'ls' -l $LIKENDIR/Liken_defaults
		echo -n "Do you want to try updating the defaults file again? [y] "
		set resp = ($<)
		if ( "$resp" == "" || $resp =~ [yY]* ) then
			goto netagain1
		endif
	endif
netagain2:
	echo 'FEATURE LikenNetDaemon xsid 2.000 26-jul-0 9999 12345678 " "' >> $LICENSEFILE
	echo 'FEATURE LikenNetClient xsid 2.000 26-jul-0 9999 12345678 " "' >> $LICENSEFILE
	if ( $status ) then
		echo " "
		echo "Error updating license file with network options:"
		echo "  Could not write to $LICENSEFILE"
		echo "    Check permissions"
		'ls' -l $LICENSEFILE
		echo -n "Do you want to try updating the defaults file again? [y] "
		set resp = ($<)
		if ( "$resp" == "" || $resp =~ [yY]* ) then
			goto netagain2
		endif
	endif

#
#   install the AppleTalk daemons etc
#
        echo ""
        echo "The network installation must be completed as 'root'."
        echo ""
        echo "It involves setting up the Liken network daemon"
        echo "to be owned by 'root', and turning on the setuid bit."
        echo ""
        echo "You will be asked to enter the 'root' password to execute"
        echo "the following two commands:"
        echo ""
        echo "  chown root $LIKENDIR/net/appletalkd"
        echo "  chmod 4755 $LIKENDIR/net/appletalkd"
suagain:
        echo " "
        if ($HOST != IBM) echo -n "'root' "
        su root -c "csh $LIKENDIR/net/setup"
        set suret = $status
        echo " "
        switch ($suret)
            case 0:   
                echo " "
                echo "Network installation completed"
                echo " "
                breaksw
 
            case 1:
                echo "Root does not have permission to modify files in the"
                echo "net directory.  This is probably because the net directory"
                echo "is NFS mounted and root on this machine does not have"
                echo "root privileges on the owner machine."
                echo " "
                echo "To complete the network installation, log on to the"
                echo "machine which physically owns the net directory and"
                echo "enter the chown and chmod commands as root."
                echo " "
                breaksw
 
            case 113:
            case 2:
                echo "The 'root' password you've entered is incorrect."
                echo -n "Do you want to try again? [y] "
                set resp = ($<)
                if ( "$resp" == "" || $resp =~ [yY]* ) then
                        goto suagain
                endif
                echo " "
                echo " "
                echo "   THE NETWORK INSTALLATION HAS FAILED "
                echo "   DUE TO AN INVALID ROOT PASSWORD "
                echo " "
                echo " "
                echo -n "Continue installation anyway? [n]"
                set resp = ($<)
                if ( $resp !~ [yY]* ) then
                        echo " "
                        echo " *******  INSTALLATION ABORTED.  *********"
                        exit
                endif
                breaksw
 
             default:
                echo " "
                echo "An error occurred changing the owner and permissions"
                echo "of appletalkd."
                echo " "
                breaksw
        endsw
else
netagain3:
        echo "liken.AllHosts.doNetworking:      False" >> $LIKENDIR/Liken_defaults       
        if ( $status ) then
                echo " "
                echo "Error updating defaults file with no-network options:"
                echo "  Could not write to $LIKENDIR/Liken_defaults"
                echo "    Check permissions"
                'ls' -l $LIKENDIR/Liken_defaults
                echo -n "Do you want to try updating the defaults file again? [y] "
                set resp = ($<)
                if ( "$resp" == "" || $resp =~ [yY]* ) then
                        goto netagain3
                endif
        endif
endif


echo Starting License Server Daemons

if ( $#SERVERS == 1 && $SERVERS[1] == `hostname` ) then
	set DAWDLE = 10
else
	echo ""
	echo "Note that the file system containing $LICENSEDIR must be"
	echo "   mounted on each server ($SERVERS)."
	echo "We will pause here so you can ensure that this is true."
	echo "   (Use another Window for mount operations.)"
	echo -n "Press <CR> when ready to continue: "
	set resp = ($<)
	set DAWDLE = 20
endif
chmod +x $LICENSEDIR/start.all 
csh $LICENSEDIR/start.all
sleep $DAWDLE

set tt = `cat $LICENSEDIR/*.log | grep "(xsid) Server started"`
if ( "$tt" != "" ) then
	echo $tt
	set licmgr = good
else
	echo "License Server failed to start."
	echo "==> license manager log files <=="
	head -999 $LICENSEDIR/*.log /dev/null | grep -v /dev/null
	echo "==> End of license manager log files <=="
	set licmgr = bad
endif

if ( $licmgr == bad ) then
	echo " "
	echo " "
	echo "   THE LICENSE MANAGER FAILED TO START "
	echo " "
	echo    "If this is because it is already running,"
	echo    "installation may continue. "
	echo " "
	echo -n "Continue installation anyway? [n] "
	set resp = ($<)
	if ( $resp !~ [yY]* ) then
		echo " "
		echo " *******  INSTALLATION ABORTED.  *********"
		exit
	endif
endif
echo ""
echo "Liken will now be started."
if ( "$BOOTDEV" != "SharedDisk" ) then
	echo "Please verify that your "
	echo -n "'System Startup' Source is ready. (<CR> to continue) "
	set resp = ($<)
endif

setenv LIKEN_DEFAULTS $LIKENDIR/Liken_defaults

$LIKENDIR/Liken -boot=$BOOTDEV

popd >/dev/null

'rm' -rf preLiken
'rm' -f Liken_defaults key-request
'rm' -f ./install_liken
'rm' -f ./install_script_template
'rm' -f ./hpea
'rm' -f ./update_script
'rm' -f ./README
echo ""
echo "Liken Installation Complete"
echo ""
echo ""
echo "A new 'Liken_defaults' file has been placed"
echo "in $LIKENDIR"
echo "Note that any user's existing  ~/.Liken_defaults"
echo "files have NOT been changed, and will"
echo "take precedence over the new one."
echo ""
'rm' -f ./install_script
exit
