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
18 aklog || echo "Failed to get new tokens"
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 if [ "x$KRB5CCNAME" != "x" ]; then
27 cp $KRB5CCNAME $NEWKRB5
29 echo "No tickets; not copying to new CC"
32 # Now actually use the new tickets.
33 KRB5CCNAME=FILE:$NEWKRB5; export KRB5CCNAME
35 # Repeat for krb4 if appropriate.
36 if [ "x$KRBTKFILE" != "x" ]; then
37 NEWKRB4=/tmp/tkt_${USER}_screen
38 KRBTKFILE=`echo $KRBTKFILE | sed 's/FILE://'`
39 cp $KRBTKFILE $NEWKRB4
40 KRBTKFILE=$NEWKRB4; export KRBTKFILE
43 # Figure out which zephyr client to use. Defaults to barnowl.
44 if [ "x$ZEPHYR_SCREEN_CLIENT" = "x" ]; then
45 barnowl=`which barnowl`
46 if [ ! -x "$barnowl" ]; then
48 barnowl=`athdir /mit/barnowl`/barnowl
50 ZEPHYR_SCREEN_CLIENT="$barnowl"
53 # Renew tickets and tokens.
54 contrenew=`which cont-renew-notify`
55 if [ ! -x "$contrenew" ]; then
56 zwrite $ATHENA_USER -d -m "$0: cont-renew doesn't exist on $(hostname)... Not doing renewals"
59 nohup $contrenew < /dev/null > /dev/null 2> /dev/null &
61 # Name the screen pag so we can reattach the right screen later.