#!/bin/csh -f
#
# setupnewuser
#	Configure an account for Cedar and X.
#  March 30, 1992
#
echo Setting up UNIX account for $USER
cd
foreach f ( .login .cshrc )
    if (! -e $f) then
	echo "Installing new user $f"
	cp -p /project/cedar10.1/newaccount/$f .
    else if ($f == .login) then
	diff $f /project/cedar10.1/newaccount/$f > /dev/null
	if ($status != 0) then
	    echo "Note: verify that existing $f adds /import/bin to PATH"
	    echo "      and that it sources \"/project/cedar10.1/scripts/cedar.login"
	endif
    endif
end

# Configure for Cedar
/project/cedar10.1/bin/CedarSetup -newuser

# Configure for runx
/import/X11R4/top/bringover

# Restore Cedar .twmrc file
if (-e .twmrc.orig) then
    mv .twmrc .twmrc.new
    mv .twmrc.orig .twmrc
endif

# give final advice
cat << //finalmessage//
[setupnewuser done.]
You now have the default .login and .cshrc file for new accounts.
You also default startup files for X windows.
Log out and log in again so your UNIX environment is propery initialized.
You can then use "runx" to start up the X window system.
You can use "RawViewersWorld" to start up Cedar directly,
or you can run Cedar after starting up X with the X11ViewersWorld command.
//finalmessage//