#!/bin/csh -f
#
# Network Installation Kit
#
# config.update: prompt for and edit update behavior
#
# Tom Coppeto
# MIT Network Group
# 17 September 1994
#
# Last Modified 4 January 1996 by jyp
#

set pltfrm = `/usr/bin/uname`

source $util/aliases

if($preset_notify == "") then
        get_response "Do you want to be notified of new software updates? (y/n)" "y" "n"
        switch($status)
                case 1:
			if ($pltfrm == "IRIX") then
                        	config.rc notify on
			else 
				config.rc NOTIFYUPDATE true
			endif
                        breaksw
                case 2:
			if ($pltfrm == "IRIX") then
                        	config.rc notify off
			else
				config.rc NOTIFYUPDATE false
			endif
                        breaksw
        endsw
else
	if ($pltfrm == "IRIX") then
		config.rc notify $preset_notify
	else
		config.rc NOTIFYUPDATE $preset_notify
	endif
endif

if($preset_auto == "") then
        get_response "Do you wish updates to take place automatically? (y/n) " "y" "n"
        switch($status)
                case 1:
			if ($pltfrm == "IRIX") then
				config.rc update  on
			else
				config.rc AUTOUPDATE true
			endif
                        breaksw
                case 2:
                        config.rc update false
                        breaksw
        endsw
else
	if ($pltfrm == "IRIX") then
        	config.rc update $preset_auto
	else
		config.rc AUTOUPDATE $preset_auto
	endif
endif

if($preset_contact == "") then
        echo "Please enter an electronic mail address to use"
        echo -n "as a contact for this machine: "
        set contact = $<
	if ($pltfrm == "SunOS") config.rc CONTACT $contact
else
	if ($pltfrm == "IRIX") then
        	set contact = $preset_auto
	else
		config.rc CONTACT $preset_auto
	endif
endif

if ($pltfrm == "IRIX") then
	echo $contact > /etc/config/contact
endif
