#!/bin/sh
#
#	/usr/athena/xinfo
#
#	This script attaches the filesystem containing the Xinfo
#	program, then executes it.  If the program cannot be found, or
#	if it exits with status -1, an appropriate message is displayed.
#
#	$Source: $
#	$Author: $
#	$Header: $
#

UNAVAILABLE=0; export UNAVAILABLE
XINFO_PROGRAM=/mit/xmit/bin/xinfo; export XOLC_PROGRAM
XINFO_LOCKER=xmit; export XINFO_LOCKER

if [ ! -r $XINFO_PROGRAM ]
then
      /bin/athena/attach -q -n $XINFO_LOCKER
fi

if [ -r $XINFO_PROGRAM ]
then
	$XINFO_PROGRAM $*
	if [ $? -eq -1 ]
	then
		UNAVAILABLE=1; export UNAVAILABLE
	fi
else
	UNAVAILABLE=1; export UNAVAILABLE
fi

if [ $UNAVAILABLE -eq 1 ]
then
	echo "
  Sorry, XInfo is currently unavailable.
  Please try again later.
"
fi
