#! /bin/sh
#
# This file should be sourced at the beginning of each adm/lic/cmd/ script:
#     . $SHOME/adm/lic/cmd/config
#
# to define various "global" variables.
#
[ "X$LIC_DEBUG" != X ] && set -x

PATH=$SHOME/splus/lib/install:$PATH
LIC_ALIASES='00=S-PLUS' export LIC_ALIASES
LIC_NUMSERVERS=1 export LIC_NUMSERVERS
SLIC_KEYDIR=${SLIC_KEYDIR-$SHOME/adm/lic/keys} export SLIC_KEYDIR
[ -d $SLIC_KEYDIR ] || (mkdir $SLIC_KEYDIR && chmod a+rx $SLIC_KEYDIR)
# This is the feature name for the main feature (i.e. S-PLUS). It is used by
# some status checking scripts.
LIC_FEATURE=${LIC_FEATURE-00} export LIC_FEATURE

### Server host name.
[ -r $SLIC_KEYDIR/$LIC_FEATURE.lic ] &&
S_ELMHOST="@`Slmhelper serverhost $SLIC_KEYDIR/$LIC_FEATURE.lic 2>/dev/null`"
export S_ELMHOST

### Get CONFIGURE-maintained information.
. $SHOME/splus/lib/install/SPLUSLIC.env

if [ -r $SHOME/splus/lib/install/LICENSE.env ]
then
    .  $SHOME/splus/lib/install/LICENSE.env
fi

# Force to full directory paths.
case "$LIC_LOGFILE" in
    /*) ;;
    *) LIC_LOGFILE="$SHOME/$LIC_LOGFILE";;
esac
case "$SLIC_KEYDIR" in
    /*) ;;
    *) SLIC_KEYDIR="$SHOME/$SLIC_KEYDIR";;
esac
case "$LIC_RESOURCES" in
    /*) ;;
    *) LIC_RESOURCES="$SHOME/$LIC_RESOURCES";;
esac
