#!/bin/csh -f
#
# Network Installation Kit
#
# install.srvnet: install menu for netops servers
#
# Tom Coppeto
# MIT Network Group
# 17 September 1994
#
# Last Modified 28 January 1996 by jyp
#

source $util/aliases

if($stage2 != "") goto stage2

version add NetServerPackage $netpkgversion

menu:

clear
echo ""
echo ""
echo "                          Installation Menu"
echo $bar
echo ""
echo ""

if (-e $misc/reboot_flag) then
        echo "You need to reboot for the installation to take effect."
	echo ""
	echo "To reboot, select 'r'"
	echo "To return to the installation menu, select 'm'"
	get_response "Enter selection (r/m): "  "r" "m"
	set choice = $status
        if ($choice == 1) then
		rm -f $misc/reboot_flag
                $util/rebootme
		exit -1
        else 
		if ($choice == 2) then
        		rm -f $misc/reboot_flag
			exit -1
        	endif
	endif
else
	echo "                      1.   Generic Server"
	echo "                      2.   Mailhub"
	echo "                      r    Return to previous menu"
endif
	
echo ""
echo ""
get_response "Menu choice: " "1" "2" "return"

set stage2 = $status
switch ($stage2)
 case 1: 

	$generic/check.client-sunos
	if($status) goto error
	$net/install.net
	if($status) goto error 
	$krb/install.kerberos
	if($status) goto error
	$afs/install.afs
	if($status) goto error
	$zephyr/install.zephyr
	if($status) goto error
	if (! -d /afs/athena.mit.edu) $misc/rc_not_boot
	$generic/check.srvnet
	breaksw
 case 2:
	$generic/check.client-sunos
	if($status) goto error
	$net/install.net
	if($status) goto error 
	$krb/install.kerberos
	if($status) goto error
	$afs/install.afs
	if($status) goto error
	$zephyr/install.zephyr
	if($status) goto error
	if (! -d /afs/athena.mit.edu) $misc/rc_not_boot
	$generic/check.srvnet 
	$netmail/install.netmail
	breaksw
 case 3:
	if (-f $rcconf) then
		config.update
	endif
	exit 0
	breaksw
endsw

goto menu


error:
echo""
echo "The installation process aborted.. cannot continue installation."
get_response "Press <return> to abort... " "<return>"
exit 1

















