config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
    elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}

for NEW in etc/freeipmi/*.new; do
  config $NEW
done
config etc/rc.d/rc.bmc-watchdog.new
config etc/rc.d/rc.ipmidetectd.new
config etc/rc.d/rc.ipmiseld.new
config etc/sysconfig/bmc-watchdog.new
( cd usr/lib64 ; rm -rf libfreeipmi.so )
( cd usr/lib64 ; ln -sf libfreeipmi.so.17.2.13 libfreeipmi.so )
( cd usr/lib64 ; rm -rf libfreeipmi.so.17 )
( cd usr/lib64 ; ln -sf libfreeipmi.so.17.2.13 libfreeipmi.so.17 )
( cd usr/lib64 ; rm -rf libipmiconsole.so )
( cd usr/lib64 ; ln -sf libipmiconsole.so.2.3.7 libipmiconsole.so )
( cd usr/lib64 ; rm -rf libipmiconsole.so.2 )
( cd usr/lib64 ; ln -sf libipmiconsole.so.2.3.7 libipmiconsole.so.2 )
( cd usr/lib64 ; rm -rf libipmidetect.so )
( cd usr/lib64 ; ln -sf libipmidetect.so.0.0.1 libipmidetect.so )
( cd usr/lib64 ; rm -rf libipmidetect.so.0 )
( cd usr/lib64 ; ln -sf libipmidetect.so.0.0.1 libipmidetect.so.0 )
( cd usr/lib64 ; rm -rf libipmimonitoring.so )
( cd usr/lib64 ; ln -sf libipmimonitoring.so.6.0.9 libipmimonitoring.so )
( cd usr/lib64 ; rm -rf libipmimonitoring.so.6 )
( cd usr/lib64 ; ln -sf libipmimonitoring.so.6.0.9 libipmimonitoring.so.6 )
( cd usr/sbin ; rm -rf ipmi-console )
( cd usr/sbin ; ln -sf ipmiconsole ipmi-console )
( cd usr/sbin ; rm -rf ipmi-detect )
( cd usr/sbin ; ln -sf ipmidetect ipmi-detect )
( cd usr/sbin ; rm -rf ipmi-ping )
( cd usr/sbin ; ln -sf ipmiping ipmi-ping )
( cd usr/sbin ; rm -rf ipmi-power )
( cd usr/sbin ; ln -sf ipmipower ipmi-power )
( cd usr/sbin ; rm -rf pef-config )
( cd usr/sbin ; ln -sf ipmi-pef-config pef-config )
( cd usr/sbin ; rm -rf rmcp-ping )
( cd usr/sbin ; ln -sf rmcpping rmcp-ping )
