#!/bin/sh
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...
}
config etc/lvm/lvm.conf.new
( cd sbin ; rm -rf vgck )
( cd sbin ; ln -sf lvm vgck )
( cd sbin ; rm -rf pvscan )
( cd sbin ; ln -sf lvm pvscan )
( cd sbin ; rm -rf vgcfgrestore )
( cd sbin ; ln -sf lvm vgcfgrestore )
( cd sbin ; rm -rf vgexport )
( cd sbin ; ln -sf lvm vgexport )
( cd sbin ; rm -rf lvcreate )
( cd sbin ; ln -sf lvm lvcreate )
( cd sbin ; rm -rf pvremove )
( cd sbin ; ln -sf lvm pvremove )
( cd sbin ; rm -rf pvdisplay )
( cd sbin ; ln -sf lvm pvdisplay )
( cd sbin ; rm -rf vgs )
( cd sbin ; ln -sf lvm vgs )
( cd sbin ; rm -rf lvresize )
( cd sbin ; ln -sf lvm lvresize )
( cd sbin ; rm -rf pvs )
( cd sbin ; ln -sf lvm pvs )
( cd sbin ; rm -rf lvmsar )
( cd sbin ; ln -sf lvm lvmsar )
( cd sbin ; rm -rf dmstats )
( cd sbin ; ln -sf dmsetup dmstats )
( cd sbin ; rm -rf pvresize )
( cd sbin ; ln -sf lvm pvresize )
( cd sbin ; rm -rf vgrename )
( cd sbin ; ln -sf lvm vgrename )
( cd sbin ; rm -rf vgchange )
( cd sbin ; ln -sf lvm vgchange )
( cd sbin ; rm -rf pvmove )
( cd sbin ; ln -sf lvm pvmove )
( cd sbin ; rm -rf vgcfgbackup )
( cd sbin ; ln -sf lvm vgcfgbackup )
( cd sbin ; rm -rf lvextend )
( cd sbin ; ln -sf lvm lvextend )
( cd sbin ; rm -rf vgimportclone )
( cd sbin ; ln -sf lvm vgimportclone )
( cd sbin ; rm -rf lvmconfig )
( cd sbin ; ln -sf lvm lvmconfig )
( cd sbin ; rm -rf vgimport )
( cd sbin ; ln -sf lvm vgimport )
( cd sbin ; rm -rf vgcreate )
( cd sbin ; ln -sf lvm vgcreate )
( cd sbin ; rm -rf lvreduce )
( cd sbin ; ln -sf lvm lvreduce )
( cd sbin ; rm -rf vgscan )
( cd sbin ; ln -sf lvm vgscan )
( cd sbin ; rm -rf lvs )
( cd sbin ; ln -sf lvm lvs )
( cd sbin ; rm -rf vgsplit )
( cd sbin ; ln -sf lvm vgsplit )
( cd sbin ; rm -rf pvck )
( cd sbin ; ln -sf lvm pvck )
( cd sbin ; rm -rf lvdisplay )
( cd sbin ; ln -sf lvm lvdisplay )
( cd sbin ; rm -rf pvcreate )
( cd sbin ; ln -sf lvm pvcreate )
( cd sbin ; rm -rf vgextend )
( cd sbin ; ln -sf lvm vgextend )
( cd sbin ; rm -rf lvremove )
( cd sbin ; ln -sf lvm lvremove )
( cd sbin ; rm -rf lvmdiskscan )
( cd sbin ; ln -sf lvm lvmdiskscan )
( cd sbin ; rm -rf lvconvert )
( cd sbin ; ln -sf lvm lvconvert )
( cd sbin ; rm -rf lvmsadc )
( cd sbin ; ln -sf lvm lvmsadc )
( cd sbin ; rm -rf vgremove )
( cd sbin ; ln -sf lvm vgremove )
( cd sbin ; rm -rf pvchange )
( cd sbin ; ln -sf lvm pvchange )
( cd sbin ; rm -rf vgmknodes )
( cd sbin ; ln -sf lvm vgmknodes )
( cd sbin ; rm -rf lvscan )
( cd sbin ; ln -sf lvm lvscan )
( cd sbin ; rm -rf vgreduce )
( cd sbin ; ln -sf lvm vgreduce )
( cd sbin ; rm -rf lvrename )
( cd sbin ; ln -sf lvm lvrename )
( cd sbin ; rm -rf vgconvert )
( cd sbin ; ln -sf lvm vgconvert )
( cd sbin ; rm -rf lvchange )
( cd sbin ; ln -sf lvm lvchange )
( cd sbin ; rm -rf vgdisplay )
( cd sbin ; ln -sf lvm vgdisplay )
( cd sbin ; rm -rf vgmerge )
( cd sbin ; ln -sf lvm vgmerge )
( cd usr/lib64 ; rm -rf libdevmapper-event-lvm2snapshot.so )
( cd usr/lib64 ; ln -sf device-mapper/libdevmapper-event-lvm2snapshot.so libdevmapper-event-lvm2snapshot.so )
( cd usr/lib64 ; rm -rf liblvm2cmd.so.2.02 )
( cd usr/lib64 ; ln -sf ../../lib64/liblvm2cmd.so.2.02 liblvm2cmd.so.2.02 )
( cd usr/lib64 ; rm -rf libdevmapper-event-lvm2mirror.so )
( cd usr/lib64 ; ln -sf device-mapper/libdevmapper-event-lvm2mirror.so libdevmapper-event-lvm2mirror.so )
( cd usr/lib64 ; rm -rf libdevmapper-event-lvm2raid.so )
( cd usr/lib64 ; ln -sf device-mapper/libdevmapper-event-lvm2raid.so libdevmapper-event-lvm2raid.so )
( cd usr/lib64 ; rm -rf libdevmapper-event.so.1.02 )
( cd usr/lib64 ; ln -sf ../../lib64/libdevmapper-event.so.1.02 libdevmapper-event.so.1.02 )
( cd usr/lib64 ; rm -rf liblvm2cmd.so )
( cd usr/lib64 ; ln -sf liblvm2cmd.so.2.02 liblvm2cmd.so )
( cd usr/lib64 ; rm -rf liblvm2app.so )
( cd usr/lib64 ; ln -sf liblvm2app.so.2.2 liblvm2app.so )
( cd usr/lib64 ; rm -rf libdevmapper-event-lvm2.so )
( cd usr/lib64 ; ln -sf libdevmapper-event-lvm2.so.2.02 libdevmapper-event-lvm2.so )
( cd usr/lib64 ; rm -rf libdevmapper-event-lvm2.so.2.02 )
( cd usr/lib64 ; ln -sf ../../lib64/libdevmapper-event-lvm2.so.2.02 libdevmapper-event-lvm2.so.2.02 )
( cd usr/lib64 ; rm -rf libdevmapper.so )
( cd usr/lib64 ; ln -sf libdevmapper.so.1.02 libdevmapper.so )
( cd usr/lib64 ; rm -rf libdevmapper.so.1.02 )
( cd usr/lib64 ; ln -sf ../../lib64/libdevmapper.so.1.02 libdevmapper.so.1.02 )
( cd usr/lib64 ; rm -rf liblvm2app.so.2.2 )
( cd usr/lib64 ; ln -sf ../../lib64/liblvm2app.so.2.2 liblvm2app.so.2.2 )
( cd usr/lib64 ; rm -rf libdevmapper-event-lvm2thin.so )
( cd usr/lib64 ; ln -sf device-mapper/libdevmapper-event-lvm2thin.so libdevmapper-event-lvm2thin.so )
( cd usr/lib64 ; rm -rf libdevmapper-event.so )
( cd usr/lib64 ; ln -sf libdevmapper-event.so.1.02 libdevmapper-event.so )
