#! /bin/sh
#
# Usage:        batch4.sh install_arguments
#
# Abstract:     This Bourne Shell script performs a license manager only
#		(type 4) type of installation in batch.
#
#		IMPORTANT: Do not use on convex or cray!
#
# Options:
#		install_arguments - arguments simply passed on without
#				    parsing to install_matlab.
#
# Note(s):	1. Supply values for the right hand side for the
#		   following 2 variables in this script. See the
#		   README in the MATLAB ./install directory for further
#		   explanation.
#
#                  WATCH OUT!
#
#                  If the MATLAB root directory is part of an AUTOMOUNTED
#                  directory supply a directory path for MATLAB that does
#                  not include any mount point information. It must be a
#                  path that forces a mount to be done if it is currently
#                  unmounted.
#
#		   MATLAB=
#		   OUTPUT_FILE=
#		   WANT_LMBOOT_LINK=		yes OR no
#		       (Ignored on lnx86.)
#
#		   NO BLANKS around the "=" in the assignments!
#
#		2. Run this script as root.
#
#               3. If this routine is sourced then the variable arglist
#                  contains any extra arguments to be passed to
#                  install_matlab. arglist should never be the empty
#                  string even when there are no arguments.
#
# Example:	1. Here is a sample dataset
#
#		   MATLAB=/usr/local/matlab  
#		   OUTPUT_FILE=/tmp/install4.out
#		   WANT_LMBOOT_LINK=no
#
# Copyright (c) 1992-95 by The MathWorks, Inc.
# $Revision: 1.10 $  $Date: 1995/05/02 14:17:03 $
#----------------------------------------------------------------------------
#+++++++++++++++ substitute right hand values as required ++++++++++++++++++
#
    MATLAB=
    OUTPUT_FILE=
#
    WANT_LICENSE_MANAGER=yes
#
    WANT_LMBOOT_LINK=
#       (Ignored on lnx86.)
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#    
    trap "rm -rf /tmp/$$a > /dev/null 2>&1; exit" 0 1 2 3 15
#
    DOLLAR_MATLAB='$MATLAB'
    if [ "$arglist" = "" ]; then
        cat > /tmp/$$a << EOF
#
# MATLAB installation: license manager only
#
MATLAB=$MATLAB
$DOLLAR_MATLAB/install_matlab $* -b 4 > $OUTPUT_FILE 2>&1 << EOF
$MATLAB
$WANT_LICENSE_MANAGER
$WANT_LMBOOT_LINK
EOF
    else
        cat > /tmp/$$a << EOF
#
# MATLAB installation: license manager only
#
MATLAB=$MATLAB
$DOLLAR_MATLAB/install_matlab $arglist -b 4 > $OUTPUT_FILE 2>&1 << EOF
$MATLAB
$WANT_LICENSE_MANAGER
$WANT_LMBOOT_LINK
EOF
    fi
#
    cat >> /tmp/$$a << EOF2
EOF
EOF2
#
    . /tmp/$$a
