#!/bin/sh

#**********************************************
#  /etc/ld.so.conf
#**********************************************
#S. Timm 3/14/02  remove the overwrite of ld.so.conf
#rpms should do it right now
#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/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
rm -f /usr/man/man8/rpc.mountd.8.gz

#**********************************************
# 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
#S. Timm...add the following configs 3/14/02
/sbin/chkconfig --level 2345 lpd off
/sbin/chkconfig kshell on
/sbin/chkconfig telnet on
/sbin/chkconfig klogin on
/sbin/chkconfig eklogin on

#**********************************************
# Run ICABOD's configurator
#**********************************************

HOSTNAME="$(grep HOSTNAME /etc/sysconfig/network | grep -v DHCP | cut -d'=' -f2 | cut -d'.' -f1)"
echo $HOSTNAME > /tmp/hostname
/root/bin/config $HOSTNAME

