#!/bin/csh -f
#
# Network Installation Kit
#
# main.client: main program for clients
#
# Tom Coppeto
# MIT Network Group
# 17 September 1994
#
# $Header: /afs/net.mit.edu/project/netconf/sgi_52/7.7tom/src/toplevels/RCS/main.athena,v 1.1 94/10/06 12:07:18 tom Exp $
#

source install.conf
source $util/aliases
setenv preset_zinstall no
setenv preset_kinstall no
setenv preset_afspart  /usr
setenv preset_afssize  50000


if($sing == true) then
        ($play $sounds/tonight.au &)
endif


clear

echo ""
echo ""
echo "                        MIT Software Installation"
echo $bar
echo ""
echo ""
echo "Welcome to the SGI network installation kit. This package will"
echo "help you install software recommended for use on the MIT campus "
echo "network. You will also have the option to install the Andrew File "
echo "System which will allow you to access many of the file resources"
echo "used by Athena."
echo ""
echo "This installation is a simplified version of the normal client"
echo "program. This version may be destructive to your system."
echo ""
echo ""
echo "Now, on with the show..."
echo ""
echo ""
get_response "Press <return> to continue..." "<return>"

clear
echo ""
echo ""
echo "                             Requirements"
echo $bar
echo ""
echo ""
echo "This installation supports the following: "
echo ""
echo "		* SGI Indy version 5.2"
echo ""
echo "If you are not running one of these, enter 'q' now"

get_response "or press <return> to continue... " "<return>" "quit"
if($status == 2) exit 0

echo ""
setenv machine SGI
setenv host `hostname`
setenv address `grep $host /etc/hosts | head -1 | awk '{print $1}'`
setenv network `grep $host /etc/hosts | head -1 | awk '{print $1}' | awk '{FS=".";print $1"."$2}'`


if(`echo $network | awk '{FS=".";print $1}'` == 18) then
        switch($network)
                case 18.58:
                case 18.62:
                case 18.63:
                case 18.70:
                case 18.71:
                case 18.72:
                case 18.74:
                case 18.75:
                case 18.78:
                case 18.80:
                case 18.82:
                case 18.83:
                case 18.84:
                case 18.87:
                case 18.88:
                case 18.92:
                        setenv broadcast $network.0.0
                        breaksw
                default:
                        setenv broadcast $network.255.255
                        breaksw
        endsw

        setenv router $network.0.1
endif

set reset = true

menu:
clear

if($reset == true) then
	if ($sing == true) ($sounds/pick_song &)
else
	set reset = true
endif

$toplevel/install.athena

	if($sing == true) then
		($play $sounds/happy_trails.au &)	
	endif
	echo ""
	echo "Remember to reboot your machine so any changes take effect."
        echo "Additional customizations may be performed in /etc/athena/rc.conf."
	echo "I hope you had a pleasant flight."
	exit 0

help:

clear
echo ""
echo ""
echo "                          About the Menus"
echo $bar
echo ""
echo ""
echo "Check configuration"
echo ""
echo "This option sanity checks your workstation for proper network"
echo "configuration. Items checked include netmask and routing "
echo "configurations."
echo ""
echo ""
echo "Install Menu"
echo ""
echo "Choose among listed packages you wish to install."
echo ""
echo ""
echo "De-Install Menu"
echo ""
echo "Choose this menu if you wish to remove a package you have previously"
echo "installed."
echo ""
echo ""
echo ""
get_response "Press <return> to continue..." "<return>"

goto menu





