#!/bin/ksh -x
#
# stuff to do after we have installed the packages for machines.
#
# version 1.1   relling   03/16/93   created
# version 1.2	rayh	  10/07/94   Made more secure and cleaned up
#					fixed for Solaris 2.4
#
#%Z%%M%	%I%	%G%	Auburn University Engineering
echo 'Starting Auburn Engineering customizations.'

if [ -f ${SI_CONFIG_DIR}/bin/set_root_pw ]; then
	echo 'Setting root password.'
	${SI_CONFIG_DIR}/bin/set_root_pw
fi
GRAPH_DRIVER=/cdrom/Solaris_2.4

echo 'Adding Auburn engineering packages.'
for i in AUengroot AUengmod AUengow AUengarc AUxdm
do
	if [ -d ${SI_CONFIG_DIR}/pkgspool/$i ]; then
		echo "y\ny\ny\ny\ny\ny\n" | pkgadd -d ${SI_CONFIG_DIR}/pkgspool -R /a $i
	fi
done


echo 'Removing sendmail startup.'
rm /a/etc/rc2.d/S88sendmail

echo 'Removing auto sys config'
rm /a/etc/.UNCONFIGURED

echo 'Removing unneeded uucp crontab.'
rm /a/var/spool/cron/crontabs/uucp
echo 'Disallowing cron jobs on client machines'
rm -f /var/spool/cron/users.allow

echo 'Making symlinks for:'
rm -rf /a/var/mail
ln -s /opt/mail /a/var/mail

echo '	games'
rm -rf /a/usr/games
ln -s /opt/games /a/usr/games

echo '	local'
rm -rf /a/usr/local
ln -s /opt/local /a/usr/local

echo '	man'
rm -rf /a/usr/share/man
ln -s /opt/man /a/usr/share/man

echo '  BSD C Compiler'
ln -s /opt/SUNWspro/SC2.0.1/acc /a/usr/ccs/bin/ucbcc
ln -s /opt/SUNWspro/SC2.0.1/tools/lint /a/usr/ccs/bin/ucblint
ln -s /opt/SUNWspro/SC2.0.1/tools/whatdir /a/usr/ccs/bin/whatdir

echo '  modules'
ln -s /opt/local/modules/modulefiles /a/modules
ln -s /opt/local/modules/obsolete /a/obsolete

echo '  interviews'
ln -s /opt/interviews/installed-CC_2.0 /a/interviews

echo '  ansys50'
ln -s /opt/ansys50 /a/ansys50

echo '  ideas'
ln -s /opt/sdrc/ideas/V /a/ideas_network

echo '  interleaf'
mkdir /a/interleaf
chmod 755 /a/interleaf
ln -s /opt/interleaf5.0 /a/interleaf/ileaf5

echo ' '


if [ -f ${SI_CONFIG_DIR}/bin/select_frame_buffer ]; then
	echo 'Check for special graphics cards....zx,sx,gx'
	${SI_CONFIG_DIR}/bin/select_frame_buffer ${GRAPH_DRIVER}
fi


if [ -f ${SI_CONFIG_DIR}/bin/make_cache ]; then
	echo 'Making cachefs'
	${SI_CONFIG_DIR}/bin/make_cache
fi

ln -s /usr/openwin/lib/X11 /a/usr/lib/X11
chmod 111 /bin/mail
cp ${SI_CONFIG_DIR}/bin/cron.allow /a/var/spool/cron/cron.allow
echo 'Adding printer install program'
cp ${SI_CONFIG_DIR}/bin/add_printer /a/etc/rc2.d/S98install_printer
#
# Switch filesystems back to slow
#
$SI_CONFIG_DIR/bin/fastfs -a slow

echo 'Finished with Auburn Engineering customizations.'