home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
- #**************************************************************************
- #* *
- #* 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 *
- #**************************************************************************
-
- #
- # This script should provide a quick easy way to configure demos to run
- # from either the CDROM or install the demo to the hard drive from where
- # it can be run.
- #
-
- # This should work in a second CDROM drive also.
- #
- if [ -f /CDROM2/Configure_Demos ]
- then
- CDDIR=CDROM2
- else
- CDDIR=CDROM
- fi
-
- FROMDIR="/$CDDIR/O2_Demos"
- TODIR="/usr/demos/General_Demos"
-
- cd $FROMDIR
-
- ROOTPW=`fgrep root /etc/passwd | cut -d: -f2`
-
- #
- # If no root password or user is root then go ahead and try to install links
- #
- if [ -z "$ROOTPW" -o `whoami` = "root" ]
- then
-
- # Remove any links in TODIR so they will not interfere with the user copying in demos
- # and ask user if any demos are installed if they want to keep them
- for i in *
- do
- if [ -l "$TODIR/$i" ]
- then
- /sbin/su - root -c "rm $TODIR/$i"
- elif [ -d "$TODIR/$i" ]
- then
- case `xconfirm -c -icon question -b Remove -B Keep \
- -t "Demo \"$i\" appears to be installed on the hard drive." \
- -t "Do you wish to remove demo \"$i\" from the hard disk and have it" \
- -t "run from CDROM instead?"`
- in
- Remove) /sbin/su - root -c "rm -rf $TODIR/$i";;
- Keep) ;;
- esac
- fi
- done
-
- if [ "Install" = `xconfirm -c -icon question -b "CD_Only" -B "Install" \
- -t "Do you wish to run all of the demos from CDROM or install some demos to the hard drive?" \
- -t "" \
- -t "All demos will run from CDROM, although a few take more than a minute to read data during start up." \
- -t "It is highly recommended that you install at least those few demos to your hard drive."` ]
- then
-
- ( sleep 4; xconfirm -c -icon info -B "Done" \
- -t "- It is highly recommended that \"perftoon\", \"egghead\" and \"Visfly\"" \
- -t " are installed on the hard drive." \
- -t "" \
- -t "- To install individual O2_demos on the hard drive." \
- -t " Drag the corresponding demo folder from the CDROM directory view" \
- -t " to the General_Demos directory view." \
- -t "" \
- -t " $FROMDIR/demoFolder ---> $TODIR" \
- -t "" \
- -t " Press \"Copy\" when prompted." \
- -t "" \
- -t "- Demo directories that are not installed on the hard drive will be" \
- -t " automatically linked and run from CDROM." \
- -t "" \
- -t "- You must close both directory view windows when you are done installing demos." \
- -t "" \
- -t "- Demo configuration can be changed by launching \"Configure_Demos\" again." 1>/dev/null 2>&1 ) &
-
- # Open both DVWs as root so that permissions are ok
- /sbin/su root -c "dirview $FROMDIR&; dirview $TODIR"
-
- fi
-
- # When the user is done copying the dirs and has closed the DVWs do or has chosen not to install any demos
- for i in *
- do
- if [ -d $TODIR/$i ] # if the user copied demo then correct permissions
- then
- /sbin/su - root -c "chown -R nobody.nobody $TODIR/$i"
- else # if the user didn't copy demo then link it
- /sbin/su - root -c "ln -s $FROMDIR/$i $TODIR/$i; chown -h nobody.nobody $TODIR/$i"
- fi
- done
- else # We don't have permissions to become root and add anything to TODIR
- xconfirm -c -B Exit -icon error -t "$0 can not run because you have a root password." \
- -t "Please either remove the root password or become root and run $0." 1>/dev/null
- exit 1
- fi
-
- . ./.performer_test
-
- cd /usr/demos/Demo_Interfaces/Web/cgi-scripts/
- ./update_tables
-
- NETSCAPES=`/sbin/ps -ef | /usr/bin/fgrep netscape | /usr/bin/fgrep -v fgrep`
-
- if [ -n "$NETSCAPES" ]
- then
- /usr/bin/X11/netscape -remote openURL\(http://localhost/Demos\)
- else
- /usr/bin/X11/netscape http://localhost/Demos &
- (
- /usr/bin/X11/xconfirm -c -B "" -t "Starting Netscape" -icon progress > /dev/null &
- pid=$!
- sleep 12
- kill $pid 2>/dev/null
- ) &
- fi
-