#!/bin/sh
#
# MIT Sun4 RC script. Installation assumes this file does not change.
# Customize behavior in rc.conf.
#
# Tom Coppeto
# MIT Network Services
# 6/27/91
#
# Last Modified 6 January 1996 by jyp
# $Author: testuser $
#

echo ""
echo  "Turning on named, afsd, and friends for help in further installation... "

. /etc/athena/rc.conf

/etc/named

if [ "${TIMECLIENT}" = "true" ]; then
		if [ -f /etc/athena/gettime ]; then
			echo -n "setting time: "                 
                	/etc/athena/gettime -s ${TIMEHUB}       
		fi
fi

if [ "${AFSCLIENT}" = "true" ]; then
	echo  -n "AFS... "                                      
	if [ -d /usr/vice/etc/modload ]; then
        	echo -n 'kernel loader.. '                   
       		cd /usr/vice/etc/modload
        	if [ -f libafs.o ]; then
                	echo -n "loading AFS.. "            
                	/usr/etc/modload ./libafs.o            > /dev/null 2>&1
                	if [ $? != 0 ]; then
                   		echo  "** error loading AFS. " 
                	fi
        	else
                	echo " **no kernel library object."  
        	fi
        	cd /
	fi

	if [ -f /etc/athena/afsd ]; then
        	echo 'afsd.. '
		echo 'Scanning the AFS cache will take about 10 minutes...Please be patient...'
		echo ''
		/etc/athena/afsd				 
	fi
	echo -n "configuring afs.. "
	/etc/athena/config_afs
	sync
	if [ -f /bin/athena/detach ]; then
		/bin/athena/detach -a
		cp /dev/null /usr/tmp/attachtab
	fi
        echo ""                                            
fi


if [ "${SNMP}" = "true" ]; then
        if [ -f /etc/snmpd ]; then
                echo -n "snmpd.. "                                  
		/etc/snmpd
        fi
fi

if [ "${ZCLIENT}" = "true" ]; then
	if [ -f /etc/athena/zhm ]; then
		echo -n "zhm.. "                               
		/etc/athena/zhm
	fi
fi

if [ "${SYSPACK}" != "" ]; then
	echo -n "attaching system pack..."       
	/bin/athena/attach -f ${SYSPACK}
fi

        
if [ "${MAILSERVER}" = "true" ]; then
	echo "sendmail..."                                    
	rm -f /usr/spool/mqueue/x*
	rm -f /usr/spool/mqueue/t*
	rm -f /usr/spool/mqueue/l*
	/usr/lib/sendmail -bd -q30m
fi

if [ -x /etc/athena/rc.local ]; then
	echo "/etc/athena/rc.local"
	/etc/athena/rc.local
fi


if [ "${NOTIFYUPDATE}" = "true" -o "${AUTOUPDATE}" = "true" ]; then
	echo "checking for updates..."                        
	if [ -x /usr/athena/etc/update_check ]; then
		/etc/athena/update_check 
	elif [ -x /etc/athena/update_check ]; then
		/etc/athena/update_checkn
	fi    
fi



echo "done!"                                                


echo ""
/usr/tmp/mit-install/util/get_response "Press <return> to continue..." "<return>"


exit 0

















