#!/bin/sh
#
# set some paths
#
AFSPATH="/afs/athena.mit.edu/project"
TTYSERVER="emmy.mit.edu"
HELP="$AFSPATH/library/help"
BIN="$AFSPATH/library/bin"
LIB="$AFSPATH/library/lib"
APPDEFS="$AFSPATH/library/app-defaults"
#
HFLAGS=""                               # flags for help windows
TFLAGS="-name xterm -geometry 80x25"    # flags for telnet windows
#
# make sure the scripts this calls get the variables
#
export AFSPATH TTYSERVER HELP BIN LIB APPDEFS HFLAGS TFLAGS
#
# This file is called with the -timeout option from xlogin.  This notices that,
# and runs the prelogin version of things.
#
if [ $1 ]
then
	if [ $1 = "-timeout" ]
	then
		exec /mit/library/.xlogin
	fi
fi
#
#figure out if this is dialup, and act appropriately
#
if [ "$DISPLAY" = "" ]
then
#
# plop up the menu
#
  while true
  do
        clear
        cat << EOF
                        LIBRARY ACCESS MENU
 
        Please enter a choice from the menu below.  Instructions for
using the selected application will appear, and then you will be given
the option of starting it.  If you choose not to connect to run the
item, you will be put back in this menu.
 
        Many more MIT Library Services are available on Athena
workstations (as opposed to this dialup interface.)  We will be adding
to the services available over dialup as they become available.  Stay
tuned!
 
    1 OWL -- ask a Reference Librarian
    2 Barton (MIT Online Catalog)
    3 Hollis (Harvard Online Catalog)
    4 Boston Library Consortium
    q Quit
 
EOF
        echo "Enter a choice and press RETURN: "
        read answer
        case $answer in

	1|[Oo][Ww][Ll])
	    $BIN/owl
	    ;;

        2|[Bb][Aa][Rr][Tt][Oo][Nn])
            $BIN/barton
            ;;

        3|[Hh][Oo][Ll][Ll][Ii][Ss])
            $BIN/hollis
            ;;

        4|[Bb][Ll][Cc])
            $BIN/blc
            ;;

        [Qq]|[Qq][Uu][Ii][Tt]|[Ee][Xx][Ii][Tt])
            exit 0
            ;;

        *)
            ;;

        esac
   done


else
#
# do the dash thing
#
   dash -name "MIT Libraries" -userdefs $APPDEFS/library.userdefs.112296 \
       -geometry +5+27 &
fi

exit 0
