#!/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/X11/x3270/ibm_hosts.new

# Update the X font indexes:
if [ -x /usr/bin/mkfontdir -o -x /usr/X11R6/bin/mkfontdir ]; then
  mkfontscale usr/share/fonts/misc 2> /dev/null
  mkfontdir -e /usr/share/fonts/encodings -e /usr/share/fonts/encodings/large usr/share/fonts/misc 2> /dev/null
fi
if [ -x /usr/bin/fc-cache ]; then
  /usr/bin/fc-cache -f 2> /dev/null
fi
( cd usr/doc/x3270-4.0ga14/html ; rm -rf documentation-faq-body.html )
( cd usr/doc/x3270-4.0ga14/html ; ln -sf ../../Webpage/documentation-faq-body.html documentation-faq-body.html )
( cd usr/doc/x3270-4.0ga14/html ; rm -rf documentation-relnotes-body.html )
( cd usr/doc/x3270-4.0ga14/html ; ln -sf ../../Webpage/documentation-relnotes-body.html documentation-relnotes-body.html )
( cd usr/doc/x3270-4.0ga14/html ; rm -rf license-body.html )
( cd usr/doc/x3270-4.0ga14/html ; ln -sf ../../Webpage/license-body.html license-body.html )
