#!/bin/csh -f -b
#ifndef _BLURB_
#define _BLURB_
#/*
#
#            Coda: an Experimental Distributed File System
#                             Release 4.0
#
#          Copyright (c) 1987-1996 Carnegie Mellon University
#                         All Rights Reserved
#
#Permission  to  use, copy, modify and distribute this software and its
#documentation is hereby granted,  provided  that  both  the  copyright
#notice  and  this  permission  notice  appear  in  all  copies  of the
#software, derivative works or  modified  versions,  and  any  portions
#thereof, and that both notices appear in supporting documentation, and
#that credit is given to Carnegie Mellon University  in  all  documents
#and publicity pertaining to direct or indirect use of this code or its
#derivatives.
#
#CODA IS AN EXPERIMENTAL SOFTWARE SYSTEM AND IS  KNOWN  TO  HAVE  BUGS,
#SOME  OF  WHICH MAY HAVE SERIOUS CONSEQUENCES.  CARNEGIE MELLON ALLOWS
#FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.   CARNEGIE  MELLON
#DISCLAIMS  ANY  LIABILITY  OF  ANY  KIND  FOR  ANY  DAMAGES WHATSOEVER
#RESULTING DIRECTLY OR INDIRECTLY FROM THE USE OF THIS SOFTWARE  OR  OF
#ANY DERIVATIVE WORK.
#
#Carnegie  Mellon  encourages  users  of  this  software  to return any
#improvements or extensions that  they  make,  and  to  grant  Carnegie
#Mellon the rights to redistribute these changes without encumbrance.
#*/
#
#static char *rcsid = "$Header: /afs/cs/project/coda-src/cvs/coda/coda-src/advice/tests/DemoSetup,v 1.1 1997/12/16 15:20:56 braam Exp $";
#endif /*_BLURB_*/

# 
#  This script sets up a machine to run the demo.  It must be
#  run prior to each run of the demo!!!  It should be run as
#  rootl.
#

#
# Please run this script as rootl
#
set reply
while (($reply != "y") && ($reply != "n"))
        echo -n "Are you running this script as rootl? [yn] "
        set reply = "$<"
end

if ($reply == "n") then
	echo "Please run this script as rootl."
	exit(-1)
endif


#
# Clean /tmp!!!
#

echo "Cleaning /tmp..."
/bin/rm -f /tmp/hdb*
/bin/rm -f /tmp/hoard*
/bin/rm -f /tmp/advice_srv*
/bin/rm -f /tmp/miss*
/bin/rm -f /tmp/command*
echo "Done cleaning /tmp."
echo ""
echo "[Hit return to continue.]"
set reply = "$<"

#
# Check the venus
#
echo ""
echo ""
echo ""
echo "Please check that this machine is running a 'good' venus."
echo "The /usr/coda/etc/venus.mre_demo on SERSE is a 'good' venus,"
echo "and this is what I used in testing the demo."
echo ""
echo "Another option, is one which Lily has setup to automatically"
echo "set the WeaklyConnected global variable in fso0.c.  You'll need"
echo "to double check that this demo still works under the new venus."
echo ""
echo "Venus should be reinit'd prior to each run of the demo."
echo ""
echo "[Hit return to continue.]"
set reply = "$<"

#
# Be paranoid
#
echo ""
echo ""
echo ""
echo "If Lu has installed the new version of cfs, make sure that"
echo "the version in /usr/coda/etc is consistent with the venus"
echo "that you chose during the DemoSetup.sh script."
echo ""
echo "[Hit return to continue.]"
set reply = "$<"


#
# Install slow, partition, and heal in /usr/coda/etc
#
echo ""
echo ""
echo ""
echo "Installing /usr/coda/bin/slow in /usr/coda/etc."
cp /usr/coda/bin/slow /usr/coda/etc
echo ""
echo "Installing /usr/coda/bin/heal in /usr/coda/etc."
cp /usr/coda/bin/heal /usr/coda/etc
echo ""
echo "Installing /usr/coda/bin/partition in /usr/coda/etc."
cp /usr/coda/bin/partition /usr/coda/etc
echo ""
echo "[Hit return to continue.]"
set reply = "$<"


#
# Install tcl/tk and the advice monitor
#
echo ""
echo ""
echo ""
echo "Please check that this machine has tcl/tk and the advice"
echo "monitor installed.  If it hasn't, then run the install.sh"
echo "script in the advice source area (or /c/u/mre/src/advice)."
echo ""
echo "[Hit return to continue.]"
set reply = "$<"

#
# Get the demo-er logged in and setup...
#
echo ""
echo ""
echo ""
echo "Log into the console of the laptop demo machine as yourself and start X."
echo ""
echo "[Hit return to continue.]"
set reply = "$<"

echo ""
echo ""
echo ""
echo "There's a bug in the tcl/tk installation in that it still"
echo "uses some files from /coda rather than /usr/coda.  I don't"
echo "have time to fix this so we're going to do a test run of"
echo "one of the tcl/tk scripts and cache the necessary files."
echo "From the machine's console, please run (as yourself):"
echo "    /usr/coda/etc/misslist /tmp/silly"
echo "Then, click on the 'Cancel' button."
echo "/coda/usr/mre/demo.wcc/vice/codaproc2.c & /usr/misc/bin/less (1)" > /tmp/silly
echo ""
echo "[Hit return to continue.]"
set reply = "$<"

echo ""
echo ""
echo ""
echo "Get coda tokens."
echo ""
echo "[Hit return to continue.]"
set reply = "$<"

echo ""
echo ""
echo ""
echo "Make two xterms..."
echo "One xterm should definitely be on the console of the machine."
echo "The other xterm should be an xtelnet from a DECstation.  Make"
echo "this xterm relatively large -- 1/2 the height of the screen."
echo "Again, the xtelnet should be as you."
echo ""
echo "[Hit return to continue.]"
set reply = "$<"

echo ""
echo ""
echo ""
echo "The laptop is now setup for the demo.  Please run the Demo"
echo "script from the second of the two xterms -- the one that may"
echo "be an xtelent.  The Demo script takes one argument -- the"
echo "hostname of the laptop machine."
echo ""
