#!/bin/csh -f
/usr/new/mh/bin/msgchk
if ($status == 0) then
# the message check revealed some messages.
  if (-f ~/.xsession) exec ~/.xsession
  exec /etc/athena/xdm/Xsession
  echo "Can't find Xsession file!"
  exit 1
else
# no waiting mail
  echo ""
  echo "You don't have any mail waiting; logging out..."
  sleep 3
  exit 0
endif
