#!/bin/sh
if [ x$DISPLAY = x ]; then
	echo "Your DISPLAY variable isn't set. I'm assuming you are trying to run Mosaic"
	echo "    from a dialup. You can't. You need to have X Windows (like cluster machines)."
	echo "    Instead, you should use a similar program, which doesn't have any graphics."
	echo "    It is called lynx, and is run from the outland locker. Please keep in mind that"
	echo "    the program may not be as stable as you might hope for, and could crash."
	echo "To run the program, type the following:"
	echo "		add outland"
	echo "		lynx"
fi
machtype=`machtype`
attach -q -n -h -a -r mime gnu outland sipb library
attach -q -h -a -r pgp graphics
PATH=$PATH:/mit/graphics/${machtype}bin:/mit/mime/bin:/mit/gnu/bin:/mit/outland/bin:/mit/pgp/bin:/mit/library/${machtype}bin
case "$machtype" in
sgi)
	;;
linux|inbsd)
	if [ x$XKEYSYMDB = x ]; then
		XKEYSYMDB=/usr/X11/lib/X11/XKeysymDB
		export XKEYSYMDB
	else
		if [ ! -r ${XKEYSYMDB} ]; then
			zwrite ${USER} -n -d -m 'Mosaic is unable to find its Motif Keysyms.'
		fi
	fi
	if [ x$XNLSPATH = x ]; then
		XNLSPATH=/usr/X11/lib/X11/locale
		export XNLSPATH
	fi
	;;
rsaix)
	if [ ! -r "/mit/x11/${machtype}lib/X11/XKeysymDB" ]; then
		if [ x$XKEYSYMDB = x ]; then
			XKEYSYMDB=/afs/athena/astaff/project/x11r5/${machtype}lib/X11/XKeysymDB
			export XKEYSYMDB
		else
			attach -q -n -h -a -r x11r5 motif1.2	
			if [ ! -r ${XKEYSYMDB} ]; then
				zwrite ${USER} -n -d -m 'Mosaic is unable to find its Motif Keysyms: "detach x11"'
			fi
		fi
	fi
	if [ x$XNLSPATH = x ]; then
		XNLSPATH=/afs/athena/astaff/project/x11r5/${machtype}lib/X11/nls
		export XNLSPATH
	fi
	MALLOC_TYPE=3.1; export MALLOC_TYPE
	;;
*)
	if [ ! -r "/mit/x11/${machtype}lib/X11/XKeysymDB" ]; then
		if [ x$XKEYSYMDB = x ]; then
			XKEYSYMDB=/afs/athena/astaff/project/x11r5/${machtype}lib/X11/XKeysymDB
			export XKEYSYMDB
		else
			attach -q -n -h -a -r x11r5 motif1.2	
			if [ ! -r ${XKEYSYMDB} ]; then
				zwrite ${USER} -n -d -m 'Mosaic is unable to find its Motif Keysyms: "detach x11"'
			fi
		fi
	fi
	if [ x$XNLSPATH = x ]; then
		XNLSPATH=/afs/athena/astaff/project/x11r5/${machtype}lib/X11/nls
		export XNLSPATH
	fi
	;;
esac
XFILESEARCHPATH=${XFILESEARCHPATH-}${XFILESEARCHPATH+:}/mit/sipb/lib/%T/%N
export PATH XFILESEARCHPATH

if xset -q | egrep -s /mit/sipb/lib/X11fonts/@sys/chinese-big5/ ; then
        /bin/true
else
        xset fp+ /mit/sipb/lib/X11fonts/@sys/
        xset fp rehash
fi

exec /mit/sipb/${machtype}etc/Mosaic "$@"






