#!/bin/sh

#**********************************************
#  /etc/ld.so.conf
#**********************************************

echo "/usr/X11R6/lib" > /etc/ld.so.conf
echo "/usr/i486-linux-libc5/lib" >> /etc/ld.so.conf
/sbin/ldconfig

#**********************************************
#  /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

#**********************************************
#  /etc/sshd_config
#**********************************************

cd /etc
if [ "$(grep "SyslogFacility AUTH" /etc/sshd_config)" = "" ] ; then
	csplit -f ssh  sshd_config /"SyslogFacility DAEMON"/
	csplit -f sshagain ssh01 2
	echo "SyslogFacility AUTH" >> ssh00
	cat sshagain01 >> ssh00
	mv ssh00 sshd_config
	rm ssh01 sshagain01 sshagain00
fi

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

cd /etc
if [ "$(grep "ALL: ALL except 127.0.0.1 : banners /etc/banners" /etc/hosts.deny)" = "" ] ; then
	csplit -f deny  hosts.deny /"ALL: ALL"/
	echo "ALL: ALL except 127.0.0.1 : banners /etc/banners" >> deny00
	mv deny00 hosts.deny
	rm deny01
fi

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

cd /etc
if ! [ "$(grep "sshd: ALL" /etc/hosts.allow)" = "" ] ; then
	csplit -f /tmp/allow  hosts.allow /"sshd: ALL"/
	mv /tmp/allow00 hosts.allow
	rm /tmp/allow01
fi

#**********************************************
# Configure PCP so that it doesn't fail on startup.
#**********************************************

/usr/sbin/install-pcp-config generic

#**********************************************
# Misc. Stuff
#**********************************************

rm -f /usr/man/man1/rec.1

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

rpm -e gpm
rpm -e kernel-pcmcia-cs
/sbin/chkconfig --del sendmail
/sbin/chkconfig --del kudzu
/sbin/chkconfig --del identd
/sbin/chkconfig --add nfslock
/sbin/chkconfig --level 345 autofs on
/sbin/chkconfig --level 345 portmap on
/sbin/chkconfig --level 345 rstatd on

