#!/bin/sh

# This script was originally written by jhawk, adapted by yak for
# whichlocker release 3, then again for the nethack server.
#
# Note: this script should be run in a PAG of its own (it will clobber
# tokens).

KRBTKFILE=/tmp/tkt_nh.$$ export KRBTKFILE
PATH=/bin:/usr/bin:/usr/ucb export PATH

/usr/athena/bin/kinit -l 2d -k -t /etc/nethack.keytab daemon/nethack.mit.edu
/bin/athena/aklog -cell sipb.mit.edu
/usr/athena/bin/kdestroy

while true ; do
  echo "Hello, $USER.  Welcome to nethack.mit.edu."
  echo "(1) NetHack 3.4.3"
  echo "(2) Slash'EM 7E7F2"
  echo "? \c"
  read menuchoice
  if [ x"$menuchoice" = "x1" ] ; then
    exec /afs/sipb.mit.edu/project/nethackserver/arch/@sys/bin/nethack.real
  elif [ x"$menuchoice" = "x2" ] ; then
    exec /afs/sipb.mit.edu/project/nethackserver/arch/@sys/bin/slashem
  fi
done
