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...
}

# Keep same perms on rc.atalk.new:
if [ -e etc/rc.d/rc.atalk ]; then
  cp -a etc/rc.d/rc.atalk etc/rc.d/rc.atalk.new.incoming
  cat etc/rc.d/rc.atalk.new > etc/rc.d/rc.atalk.new.incoming
  mv etc/rc.d/rc.atalk.new.incoming etc/rc.d/rc.atalk.new
fi

config etc/rc.d/rc.atalk.new

config etc/netatalk/AppleVolumes.default.new
config etc/netatalk/AppleVolumes.system.new
config etc/netatalk/afp_ldap.conf.new
config etc/netatalk/afpd.conf.new
config etc/netatalk/afppasswd.new
config etc/netatalk/atalkd.conf.new
config etc/netatalk/netatalk.conf.new 
config etc/netatalk/papd.conf.new
# Don't need an empty file:
rm -f etc/netatalk/afppasswd.new
( cd usr/bin ; rm -rf hqx2bin )
( cd usr/bin ; ln -sf megatron hqx2bin )
( cd usr/bin ; rm -rf single2bin )
( cd usr/bin ; ln -sf megatron single2bin )
( cd usr/bin ; rm -rf unsingle )
( cd usr/bin ; ln -sf megatron unsingle )
( cd usr/bin ; rm -rf unhex )
( cd usr/bin ; ln -sf megatron unhex )
( cd usr/bin ; rm -rf macbinary )
( cd usr/bin ; ln -sf megatron macbinary )
( cd usr/bin ; rm -rf binheader )
( cd usr/bin ; ln -sf megatron binheader )
( cd usr/bin ; rm -rf nadheader )
( cd usr/bin ; ln -sf megatron nadheader )
( cd usr/bin ; rm -rf unbin )
( cd usr/bin ; ln -sf megatron unbin )
( cd usr/sbin ; rm -rf tfwmpap )
( cd usr/sbin ; ln -sf psf tfwmpap )
( cd usr/sbin ; rm -rf tfmpaprev )
( cd usr/sbin ; ln -sf psf tfmpaprev )
( cd usr/sbin ; rm -rf tfpap )
( cd usr/sbin ; ln -sf psf tfpap )
( cd usr/sbin ; rm -rf ifpap )
( cd usr/sbin ; ln -sf psf ifpap )
( cd usr/sbin ; rm -rf tfwpaprev )
( cd usr/sbin ; ln -sf psf tfwpaprev )
( cd usr/sbin ; rm -rf ifmpaprev )
( cd usr/sbin ; ln -sf psf ifmpaprev )
( cd usr/sbin ; rm -rf ofwmpap )
( cd usr/sbin ; ln -sf psf ofwmpap )
( cd usr/sbin ; rm -rf tfpaprev )
( cd usr/sbin ; ln -sf psf tfpaprev )
( cd usr/sbin ; rm -rf ifwpap )
( cd usr/sbin ; ln -sf psf ifwpap )
( cd usr/sbin ; rm -rf tfwmpaprev )
( cd usr/sbin ; ln -sf psf tfwmpaprev )
( cd usr/sbin ; rm -rf ifwmpap )
( cd usr/sbin ; ln -sf psf ifwmpap )
( cd usr/sbin ; rm -rf ofpap )
( cd usr/sbin ; ln -sf psf ofpap )
( cd usr/sbin ; rm -rf ifmpap )
( cd usr/sbin ; ln -sf psf ifmpap )
( cd usr/sbin ; rm -rf ifpaprev )
( cd usr/sbin ; ln -sf psf ifpaprev )
( cd usr/sbin ; rm -rf ifwmpaprev )
( cd usr/sbin ; ln -sf psf ifwmpaprev )
( cd usr/sbin ; rm -rf tfwpap )
( cd usr/sbin ; ln -sf psf tfwpap )
( cd usr/sbin ; rm -rf tfmpap )
( cd usr/sbin ; ln -sf psf tfmpap )
( cd usr/sbin ; rm -rf ofwpap )
( cd usr/sbin ; ln -sf psf ofwpap )
( cd usr/sbin ; rm -rf ifwpaprev )
( cd usr/sbin ; ln -sf psf ifwpaprev )
( cd usr/sbin ; rm -rf ofmpap )
( cd usr/sbin ; ln -sf psf ofmpap )
