#!/bin/csh -f
#
# Network Installation Kit
#
# install.srvnet: install menu for netops servers
#
# Tom Coppeto
# MIT Network Group
# 17 September 1994
#
# $Header: /afs/net.mit.edu/project/netconf/sun4/7.7tom/src/toplevels/RCS/install.srvnet,v 1.1 94/09/18 11:54:01 tom Exp Locker: nocuser $
#

source $util/aliases

if($stage2 != "") goto stage2

version add NetServerPackage $netpkgversion

menu:

clear
echo ""
echo ""
echo "                          Installation Menu"
echo $bar
echo ""
echo ""
echo "                      1.   Generic Server"
echo "                      2.   Mailhub"
echo "                      r    Return to previous menu"
echo ""
echo ""
get_response "Menu choice: " "1" "2" "return"

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

	$generic/check.client
	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 (! -f /usr/athena/bin) then
		echo "srvnet 1 $interactive" > /etc/mit-stage2
                install -c -m 555 $util/continue-install /etc
		rebootme
	else
		goto stage2
	endif
	breaksw
 case 2:
	$generic/check.client
	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 (! -f /usr/athena/bin) then
		echo "srvnet 2 $interactive" > /etc/mit-stage2
		 install -c -m 555 $util/continue-install /etc
		rebootme
	else	
		goto stage2
	endif
	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 "abort... " "<return>"
exit 1

stage2:


echo "picking up where we left off.."
sleep 2
$generic/check.srvnet
switch ($stage2)
	 case 2:
		$netmail/install.netmail
		breaksw
endsw	

goto menu

