#!/bin/csh -f

#
#	This script attaches the filesystem containing the Techinfo
#	program, then executes it.  If the program cannot be found, or
#	if it exits with status -1, an appropriate message is displayed.
#

set ti_script=/mit/techinfo/techinfo
set ti_locker=techinfo

onintr cleanup				#  Handle interrupts sensibly


if (! -e $ti_script) /bin/athena/attach -n $ti_locker > /dev/null

if (-e $ti_script) then
	$ti_script $*
	if ($status == -1) set unavailable
else
	set unavailable
endif

if ($?unavailable) then
	/usr/ucb/more -d << EOF
Sorry, the Techinfo is currently unavailable.

Call 3-4101 for help.

EOF
endif

cleanup:
onintr					#  Now, ignore interrupts
echo ""
exit 0
