:
#
#	Procedure BRSMAINT
#
#		SCCS ID is "@(#) BRS brsmaint.sh v61.2 (8/28/92) { Release 6.1 }"
#

if [ $# -gt 2 ] ; then
	echo "brsmaint: invalid arguments"
	exit 1
	fi

if [ $# = 1 -a \( "x$1" = x-h -o "x$1" = x-help \) ] ; then
	echo "
The BRSMAINT Procedure -
     Procedure to start the BRS/MAINT System

COMMAND FORMAT:
	brsmaint [OPTION]

	Optional Parameters:
		{-log USER}

DESCRIPTION:

     This  procedure invokes the BRS/Maint System Administration System.
     The only valid parameters are -log followed by a user's names.
"
	exit 2
	fi

if [ $# = 1 -a \( x$1 = x-u -o x$1 = x-unlock \) ] ; then
	Dir=`brsconfig BIN`
	if [ ! -s ${Dir}brslock ] ; then
		echo "brsmaint: cannot locate brslock program"
		exit 3
		fi
	${Dir}brslock -maint
	exit $?
elif [ $# = 1 -o \( $# = 2 -a "$1" != "-log" \) ] ; then
	echo "brsmaint: invalid arguments"
	exit 3
	fi

if [ $# = 2 ] ; then
	u="-log $2"
else
	u=""
	fi

# determine location of one-proc model 

Dir=`brsconfig BIN`
if [ -s "${Dir}brsadmin" ] ; then
	Prog=${Dir}brsadmin
	fi

exec ${Prog} -d MAINT -m MAIN_ $u
