#!/bin/sh

#**********************************************
#  /etc/syslog.conf
#**********************************************

cd /etc
if [ "$(grep "auth.*							/var/log/secure" /etc/syslog.conf)" = "" ] ; then
	csplit -f auth syslog.conf /"var/log/secure"/+1
	echo "auth.*							/var/log/secure" >> auth00
	cat auth01 >> auth00
	mv auth00 syslog.conf
	rm auth01
fi
echo "auth.*							@watchlog" >> syslog.conf

#**********************************************
#  /etc/hosts.deny
#**********************************************

cd /etc
mv hosts.deny hosts.deny.orig
cp /etc/$WORKGROUP/configfiles/hosts.deny /etc/hosts.deny

#**********************************************
#  /etc/hosts.allow
#**********************************************

cd /etc
mv hosts.allow hosts.allow.orig
cp /etc/$WORKGROUP/configfiles/hosts.allow /etc/hosts.allow

#***********************************************
# Intall yum cron job that only check's for updates
# but does not install them automatically
#***********************************************

cd /etc/yum.d
cp yum.cron.check /etc/cron.daily/yum.cron
cd /etc

#**********************************************
# Configure PCP so that it doesn't fail on startup.
# and put a script to run it daily
#**********************************************

/usr/sbin/install-pcp-config generic
cp /etc/$WORKGROUP/configfiles/pmlogger.cron /etc/cron.daily/pmlogger.cron

#**********************************************
# Edit /etc/hosts to add the short name
#**********************************************

sed -e 's/[	 ]\([a-z0-9-]*\)\.fnal\.gov$/&	\1/' /etc/hosts > /etc/hosts.tmp
mv /etc/hosts /etc.hosts.old
mv /etc/hosts.tmp /etc/hosts

#**********************************************
# Set up NIS.
#**********************************************

cp /etc/$WORKGROUP/configfiles/nsswitch.conf /etc/nsswitch.conf
/usr/sbin/authconfig --kickstart --enablenis --nisdomain fsun01.fnal.gov
/sbin/chkconfig --level 345 ypbind on

#**********************************************
# Set up .forward.
#**********************************************

echo scs-root@fnal.gov > /root/.forward



#**********************************************
# Enable kerberized telnet, ftp and rsh
#**********************************************

/sbin/chkconfig telnet on
/sbin/chkconfig ftp on
/sbin/chkconfig kshell on
/sbin/chkconfig klogin on
/sbin/chkconfig eklogin on

#**********************************************
# Copy in the SCS root .k5login
#**********************************************

cp /etc/$WORKGROUP/configfiles/SCS.k5login /root/.k5login

#**********************************************
# Configure rstatd to start at boot
#**********************************************

/sbin/chkconfig --level 345 rstatd on

#**********************************************
# Create courtesy links to setups
#**********************************************

cd /usr/local/etc
ln -s /afs/fnal.gov/ups/etc/setups.sh setups.sh
ln -s /afs/fnal.gov/ups/etc/setups.csh setups.csh

#**********************************************
# Remove Programs from startup.
#**********************************************

/sbin/chkconfig --del sendmail
/sbin/chkconfig --del kudzu
/sbin/chkconfig --del identd
/sbin/chkconfig --del apmd
/sbin/chkconfig --del lpd
/sbin/chkconfig --del rhnsd
/sbin/chkconfig --del ipchains
/sbin/chkconfig --del iptables


