#!/bin/csh

# Written by : Renae Batina
#              11 March 1994
#
# This shell script sets up a users environment to use wavefront.
#
# The files option, copies the setup files into the users areas.  These files
# are concerned with setting the users environment, hence the majority goes
# into ~/.cshrc
#
# The teach directory, contains sample files used in wavefront
#

set teach_area = ~wavefrnt/TAV2.11/teach
set unit_area = /usr/units/X_setup

if ($#argv != 1) then
        # Error message
	echo "Usage: /usr/units/X_setup/wavefront_setup -all | -tute | -files"
	exit 1
else
	set option = $argv[1]
endif

switch ($option)
	case all:
		echo Installing files
		cp $unit_area/.wfrc ~/.wfrc
		cat $unit_area/wavefront_cshrc >> ~/.cshrc

		echo Installing tutes
		if (-d ~/teach) then
			echo Directory teach exists
		else
			cp -r $teach_area ~/
			chmod -R 755 ~/teach
		endif
	breaksw

	case files:
		echo Installing files
		cp $unit_area/.wfrc ~/.wfrc
		cat $unit_area/wavefront_cshrc >> ~/.cshrc
	breaksw

	case tute:
		echo Installing tutes
		if (-d ~/teach) then
			echo Directory teach exists
		else
			cp -r $teach_area ~/
			chmod -R 755 ~/teach
		endif
	breaksw
	default:
		echo "Usage: wfrnt_setup -all | -tute | -files"
	breaksw
endsw
