#!/bin/sh
#
# @(#)getOSFinstdir	1.3	LPS_UNX_COM	2/16/95
#
# getOSFinstdir
#
# Script to derive the proper OSF/1 installation directory path
# based on the specified LPS release number.
#
# Parameters:
#    $1 - LPS release number, eg: "5.1"
#
# Global variables:
#    --none--
#
# Exit values:
#    0 - Success, the path was written to stdout.
#    1 - Error, all messages go to stderr.
###
 
SYSVERSION="$1"

# The form of the system version we expect is VERY RIGID and must
# be in the form "m.n" (eg, "5.1").  Anything else...and we BARF.

if [ -z "$SYSVERSION" -o `expr "$SYSVERSION" : '.*'` -ne 3 ]
then
    cat <<EOF  1>&2
    Invalid LPS system version string: $SYSVERSION

    Unable to derive the OSF/1 installation directory path!

    Press RETURN to continue...
EOF
    pause
    exit 1
fi

suffix="0`echo $SYSVERSION | cut -c1,3`"  # Produces "0mn"

echo "/opt/LPSBASE$suffix"

exit 0
