#! /bin/sh
#
# Setup script for clients
#
if [ -r scripts/setup_functions ]
	then
		. scripts/setup_functions
else
	if [ -r /usr/local/bcnu/scripts/setup_functions ]
		then
			. /usr/local/bcnu/scripts/setup_functions
	fi
fi

clear

cat <<END;
Welcome to the setup script for bcnu clients.
 
The script will offer default settings which you can override and will
ask for some basic information from you to enable the system to be set
up as quickly and easily as possible.

Defaults or detected settings will be presented in [brackets], accept
these by pressing enter, or enter an alternative value

END

# set bcnu home directory
bcnu_home_dir

# get the system type

bcnu_system_type
#

# setup up sample config file
bcnu_sample_agent

if [ "$SAMPLEAGENT" = "yes" ]
	then
		cp $BCNUHOME/platform/agents.$BCNUSERVER $BCNUHOME/etc/agents.distrib
fi

$BCNUHOME/scripts/client_install -h $BCNUHOME -c $BCNUSERVER -d y -l y -s y

rm /tmp/*.distrib

sleep 5

echo "Setup: Client install completed"

if [ -f $BCNUHOME/README.$BCNUSERVER ]
	then
		more $BCNUHOME/README.$BCNUSERVER
fi
