#! /bin/sh
# @(#)LICENSE version 3.5 created 2/21/95
# @(#)Copyright (c), 1987, 1995 StatSci, Inc.  All rights reserved.
#
# Interface to the license manager software used by S-PLUS.
#
usage='Usage:

Splus LICENSE <command> [<command arg> ...]

where "<command>" is one of the following:

admin - low level interface to the elmadmin command.
alert - interface to the elmalert command to notify you if a license becomes
    available or or is close to expiration.
features - print a list of the license "feature names" along with their
    aliases. The "feature names" are numbers like "00" and aliases are the
	readable versions like "S-PLUS".
hostinfo - print out the host identification information necessary to generate
    a license key for this system.
install - install a new license key.
logfile - returns the name of the license server log file.
resources - returns the name of the license server resource file.
rpt - interface to the elmrpt command to generate reports of license
    usage activity.
server - "start"/"stop" the license server, list "status" of license server or
    get the name of the server host.
usage - interface to the elmusage command to generate a continue display of
    license usage information.
users - lists the user information for each license currently checked out.
'

PATH=$SHOME/adm/lic/cmd:$PATH export PATH

[ $# -eq 0 ] && echo "$usage" >&2 && exit 1

cmd="$1"; shift
if [ -f $SHOME/adm/lic/cmd/$cmd ]
then
    . $SHOME/adm/lic/cmd/config
    exec $SHOME/adm/lic/cmd/$cmd ${1+"$@"}
else
    echo "Invalid LICENSE command: $cmd" >&2
    echo "$usage" >&2
    exit 1
fi
