#
# program to start athena environment
#
# Last Modified 11 November 1995 by jyp
#

set pltfrm = `/usr/bin/uname`

set path = (/bin/athena /bin /usr/ucb /usr/athena/bin $path)


if ((! -d /usr/athena/bin) && ($pltfrm == "SunOS")) attach -q -n athena
if ($pltfrm == "IRIX") attach -q -n athena

rehash

if ($pltfrm == "SunOS") /usr/athena/etc/zhm >& /dev/null

set username = ""
while ($username == "")
	echo -n "username: "
	set username = $<
end

kinit $username
if($status) then
	exit 1
endif


attach $username
if(! $status) then
	set home = /mit/$username
	if ($pltfrm == "SunOS") then
		zwgc
		dash &
		dash -logout &
	endif
endif

