#!/bin/bash

# make sure needed services are on
/sbin/chkconfig --level 35 portmap on
/sbin/chkconfig --level 35 nfslock on

# remove horrible things
rpm -e arpwatch
rpm -e rwho
rpm -e rusers
rpm -e routed

#
# jason harrington <jason@fnal.gov> 26feb2002
# bandaids for cdfsoft and ld
#
if [ ! -h /usr/lib/libhistory.so.3 ] && [ -e /usr/lib/libhistory.so ]
then
        ln -s /usr/lib/libhistory.so  /usr/lib/libhistory.so.3
fi

if [ ! -h /usr/lib/libreadline.so.3 ] && [ -e /usr/lib/libreadline.so ]
then
        ln -s /usr/lib/libreadline.so /usr/lib/libreadline.so.3
fi

if [ ! -h /usr/lib/libncurses.so.4 ] && [ -e /usr/lib/libncurses.so ]
then
        ln -s /usr/lib/libncurses.so  /usr/lib/libncurses.so.4
fi
#
# end of addition
#

#
# jason harrington <jason@fnal.gov> 27feb2002
# nis/pam_krb5/gdm don't play well together, so switching to kdm
#
echo 'DESKTOP="KDE"' > /etc/sysconfig/desktop
#
# end of addition
#

#
# jason harrington <jason@fnal.gov> 15may2002
# a couple of directories i like to have around for a cleaner autofs and a
# temporary mount point...as for autofs, i will be adding a modified RPM to
# the workgroup to reflect the new convention
#
mkdir -p /mnt/autofs
mkdir -p /mnt/tmp
#
# end of addition
#

#
# jason harrington <jason@fnal.gov> 15may2002
# some seem to believe that there are services which should be active by
# default...needless to say, i disagree...
#
/sbin/chkconfig --level 0123456 isdn off
/sbin/chkconfig --level 0123456 pppoe off
/sbin/chkconfig --level 0123456 rawdevices off
/sbin/chkconfig --level 0123456 rhnsd off
/sbin/chkconfig --level 0123456 lpd off
/sbin/chkconfig --level 0123456 netfs off
/sbin/chkconfig --level 0123456 ipchains off
#
# end of addition
#

#
# jason harrington <jason@fnal.gov> 12sep2002
# more bandaids for cdfsoft
#
ln -s /usr/lib/gcc-lib/i386-redhat-linux/2.96/libg2c.a /usr/lib/libg2c.a
#
# end of addition
#

#
# jason harrington <jason@fnal.gov> 19nov2002
# config modification script for ganglia monitoring tool
#
BASE="gmond.conf"
CONFIG="/etc/${BASE}"
TMP="/tmp/${BASE}"

if [ -f $CONFIG ]
then
	if /bin/hostname | /bin/egrep -e "fcdfcaf|fcdfdata|fcdfmon|fcdfhead|fcdfcons"
	then
		/bin/sed s/#\ name.*/name\ \"CDF\ CAF\"/ $CONFIG > $TMP
	else
		/bin/sed s/#\ name.*/name\ \"CDF\ Offline\"/ $CONFIG > $TMP
	fi

	/bin/sed s/#\ owner\ .*/owner\ \"CDF\ Task\ Force\"/ $TMP > $CONFIG

	/bin/rm $TMP
fi
#
# end of addition
#

#
# jason harrington <jason@fnal.gov> 27dec2002
# repaired 10mar2003 (made more general)
# more bandaids for cdfsoft
#
ln -s /usr/lib/libreadline.so /usr/lib/libreadline.so.4.1
#
# end of addition
#

#
# jason harrington <jason@fnal.gov> 10mar2003
# more of the same
#
ln -s /usr/lib/libhistory.so /usr/lib/libhistory.so.4.1
#
# end of addition
#
