#!/bin/csh -f
clear
echo "Running 15-213 login setup program..."
echo ""
set TOP=/afs/cs/academic/class/15213-s00
set HOME=$home
set USER=$user
if (-e ${HOME}/15-213) then
    echo "There is already a file of some sort named '15-213' in your"
    echo "home directory."
else
    mkdir ${HOME}/15-213
    fs sa ${HOME}/15-213 system:campusnet rl
    echo "${USER}@ANDREW.CMU.EDU" > ${HOME}/15-213/.klogin
    cp ${TOP}/bin/simple.login ${HOME}/15-213/.login

    echo "I have created a directory '15-213' in your home directory"
    echo "and granted read access to system:campusnet. This directory"
    echo "contains files '.klogin' and '.login', which are required to"
    echo "allow you to login to the FISH computers and authenticate to"
    echo "AFS. Do NOT store your course files in this directory."
    echo ""
    echo "NOTE: you must use ${USER}@andrew.cmu.edu to login to the"
    echo "FISH machines."
endif
echo ""
