#!/bin/sh
#Tag 0x9085

#**************************************************************************
#*                                                                        *
#*            Copyright (c) 1996 Silicon Graphics, Inc.                   *
#*                      All Rights Reserved                               *
#*                                                                        *
#*         THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI             *
#*                                                                        *
#* The copyright notice above does not evidence any actual of intended    *
#* publication of such source code, and is an unpublished work by Silicon *
#* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
#* the property of Silicon Graphics, Inc. Any use, duplication or         *
#* disclosure not specifically authorized by Silicon Graphics is strictly *
#* prohibited.                                                            *
#*                                                                        *
#* RESTRICTED RIGHTS LEGEND:                                              *
#*                                                                        *
#* Use, duplication or disclosure by the Government is subject to         *
#* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in   *
#* Technical Data and Computer Software clause at DFARS 52.227-7013,      *
#* and/or in similar or successor clauses in the FAR, DOD or NASA FAR     *
#* Supplement. Unpublished - rights reserved under the Copyright Laws of  *
#* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N.       *
#* Shoreline Blvd., Mountain View, CA 94039-7311                          *
#**************************************************************************

# Where do we want to go
URL="data/intro.html"

#
# Default place to start up Netscape at,
# currently assuming a 1280x1024 display
#
GEOMETRY="1250x970+15+0"

#
# If USER not null, assume script is being run from the Web Interface
# under the USER name as nobody. So we need to set up a fake home
# directory. 
# If USER is set then this script was run from the desktop, and
# everything is fine.
#

if [ -z "$USER" ] ; then
	HOME="/tmp/nobodyNetscapeHome" ; export HOME
	DISPLAY="localhost:0.0"; export DISPLAY
	if [ ! -d $HOME ] ; then
		mkdir -p $HOME/.netscape/cache
		if [ -f /usr/demos/Demo_Interfaces/Web/common/preferences ] ; then
			cp /usr/demos/Demo_Interfaces/Web/common/preferences $HOME/.netscape
		fi
	elif [ -l $HOME/.netscape/lock ] ; then
			rm $HOME/.netscape/lock
	fi
	/usr/bin/X11/netscape -geometry $GEOMETRY $URL
else
	if [ -f $HOME/.Xdefaults ] ; then
		mv $HOME/.Xdefaults $HOME/.Xdefaults.tmp
	fi
	/usr/bin/X11/netscape -geometry $GEOMETRY $URL
	if [ -f $HOME/.Xdefaults.tmp ] ; then
		mv $HOME/.Xdefaults.tmp $HOME/.Xdefaults
	fi
fi
