#!/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`
if [ "x$ATHENA_SYS" = x ]; then
	ATHENA_SYS=@sys
fi
attach -q -n -h -a -r graphics mime gnu outland sipb library
attach -q -h -a -r pgp

PATH=$PATH:/mit/graphics/arch/${ATHENA_SYS}/bin:/mit/mime/bin:/mit/gnu/bin:/mit/outland/bin:/mit/pgp/bin:/mit/library/${machtype}bin

if [ x$XKEYSYMDB = x ]; then
	XKEYSYMDB=/usr/lib/X11/XKeysymDB
	export XKEYSYMDB
fi
if [ x$XNLSPATH = x ]; then
	XNLSPATH=/usr/lib/X11/nls
	export XNLSPATH
fi

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/arch/${ATHENA_SYS}/etc/Mosaic "$@"
