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/glxosd.conf.new

# Update the X font indexes:
if [ -x /usr/bin/mkfontdir ]; then
  ( cd /usr/share/fonts/TTF
    mkfontscale .
    mkfontdir .
  )
fi

if [ -x /usr/bin/fc-cache ]; then
  /usr/bin/fc-cache -f
fi
( cd usr/lib64/glxosd ; rm -rf libglxosd-elfhacks.so )
( cd usr/lib64/glxosd ; ln -sf libglxosd-elfhacks.so.1 libglxosd-elfhacks.so )
( cd usr/lib64/glxosd ; rm -rf libglxosd-elfhacks.so.1 )
( cd usr/lib64/glxosd ; ln -sf libglxosd-elfhacks.so.1.0.1 libglxosd-elfhacks.so.1 )
( cd usr/lib64/glxosd ; rm -rf libglxosd-glinject.so )
( cd usr/lib64/glxosd ; ln -sf libglxosd-glinject.so.2 libglxosd-glinject.so )
( cd usr/lib64/glxosd ; rm -rf libglxosd-glinject.so.2 )
( cd usr/lib64/glxosd ; ln -sf libglxosd-glinject.so.2.2.1 libglxosd-glinject.so.2 )
( cd usr/lib64/glxosd ; rm -rf libglxosd-plugins-libsensors-support.so )
( cd usr/lib64/glxosd ; ln -sf libglxosd-plugins-libsensors-support.so.2 libglxosd-plugins-libsensors-support.so )
( cd usr/lib64/glxosd ; rm -rf libglxosd-plugins-libsensors-support.so.2 )
( cd usr/lib64/glxosd ; ln -sf libglxosd-plugins-libsensors-support.so.2.5.0 libglxosd-plugins-libsensors-support.so.2 )
( cd usr/lib64/glxosd ; rm -rf libglxosd.so )
( cd usr/lib64/glxosd ; ln -sf libglxosd.so.2 libglxosd.so )
( cd usr/lib64/glxosd ; rm -rf libglxosd.so.2 )
( cd usr/lib64/glxosd ; ln -sf libglxosd.so.2.5.0 libglxosd.so.2 )
