#
# usage:        getlmhid.sh
#
# abstract:     This Bourne Shell script gets lmhostid.
#
# note(s):      1. This routine must be called using a . (period)
#
# Copyright (c) 1992-1997 by The MathWorks, Inc.
# $Revision: 1.11 $  $Date: 1998/12/31 20:53:58 $
#----------------------------------------------------------------------------
#
#			Get lmhostid [-l option]
#               	------------
#
# We assume that we have not changed directories since the orginal
# invocation (at $WD).
#
    file=license.dat
#
    cmd="hostname"
    . $dir/$searchp_sh
    if [ "$pathlist" = "" ]; then
        Hostname=`uname -n`
    else
        Hostname=`hostname`
    fi
#
    HostID=`$etc_lmhostid_exe | sed -n -e '/FLEXlm host ID/s/^[^"]*"//p' \
                              | sed -n -e '/"/s/".*//p'`
#
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo "                     Preparing Your 'license.dat' File"
echo '--------------------------------------------------------------------------------'
echo "| A 'license.dat' file is required to run MATLAB and to decrypt product files  |"
echo '| during installation. This file contains license server information and       |' 
echo '| FEATURE/INCREMENT lines. A License File containing the FEATURE/INCREMENT     |'
echo "| lines is generated by The MathWorks using a string called the 'lmhostid' or  |"
echo '| license server hostid.                                                       |'
echo "            The 'lmhostid' for this host ($Hostname) is:     $HostID"
echo '| If your license server is another host. login to that host and in the MATLAB |'
echo '| root directory ($MATLAB)'" repeat the command, './install_matlab -l'.          |"
echo '|                                                                              |'
echo '| First time users should place a copy of the License File in                  |'
echo '| $MATLAB/'"license.dat. Existing users should first move your 'license.dat'     |"
echo '| file, normally in $MATLAB/etc, to $MATLAB and manually merge in the most     |'
echo "| recent License File. The 'license.dat' file will be merged in automatically  |"
echo '| with a skeleton one during installation to become $MATLAB/etc/license.dat.   |'
echo '| If you need a License File PLEASE contact:                                   |'
echo '|                                                                              |'
echo '|           The MathWorks, Inc.           (508) 647-7000                       |'
echo '|    email: service@mathworks.com                                              |'
echo '|                                                                              |'
echo "| See the MATLAB Installation Guide for the structure of the 'license.dat'     |"
echo '| file.                                                                        |'
echo '--------------------------------------------------------------------------------'
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    . $dir/$cleanup_sh
    exit 0
