5 # Check for pre-existing screens.
6 screenlist=`$screen -list | grep owl`
7 if [ "x$screenlist" != "x" ]; then
8 echo "Found a pre-existing owl-screen session:"
10 echo "You probably want to reattach it instead."
15 # Get AFS tokens for the screen session.
16 # We are now in a new PAG (because of pagsh).
17 # If you want to get tokens for other cells, list them in ~/.xlog
20 # Use separate kerberos tickets for screen. Even if we accidentally
21 # (or intentionally) log out, screen and owl will still have tickets.
22 NEWKRB5=/tmp/krb5cc_${USER}_screen
24 # Copy the tickets we obtained on login to the screen tickets.
25 KRB5CCNAME=`echo $KRB5CCNAME | sed 's/FILE://'`
26 cp $KRB5CCNAME $NEWKRB5
28 # Now actually use the new tickets.
29 KRB5CCNAME=FILE:$NEWKRB5; export KRB5CCNAME
31 # Repeat for krb4 if appropriate.
32 if [ "x$KRBTKFILE" != "x" ]; then
33 NEWKRB4=/tmp/tkt_${USER}_screen
34 KRBTKFILE=`echo $KRBTKFILE | sed 's/FILE://'`
35 cp $KRBTKFILE $NEWKRB4
36 KRBTKFILE=$NEWKRB4; export KRBTKFILE
39 # Figure out which zephyr client to use. Defaults to barnowl.
40 if [ "x$ZEPHYR_SCREEN_CLIENT" = "x" ]; then
41 barnowl=`which barnowl`
42 if [ ! -x "$barnowl" ]; then
44 barnowl=`athdir /mit/barnowl`/barnowl
46 ZEPHYR_SCREEN_CLIENT="$barnowl"
49 # Renew tickets and tokens.
50 contrenew=`which cont-renew-notify`
51 if [ ! -x "$contrenew" ]; then
52 zwrite $ATHENA_USER -d -m "$0: cont-renew doesn't exist on $(hostname)... Not doing renewals"
55 nohup $contrenew < /dev/null > /dev/null 2> /dev/null &
57 # Name the screen pag so we can reattach the right screen later.