#!/bin/csh -f

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


set sis_script=/afs/athena.mit.edu/astaff/project/sis_dev/sis/sis
set sis_locker=sis
set sis_appdefs=/mit/sis/Olsi
onintr cleanup				#  Handle interrupts sensibly


if (! -e $sis_appdefs) /bin/athena/attach -n $sis_locker > /dev/null

if (-e $sis_script && -e $sis_appdefs) then
	$sis_script $*
	if ($status == -1) set unavailable
else
	set unavailable
endif

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

Call 3-4101 for help.

EOF
endif

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