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.yp.new:
if [ -e etc/rc.d/rc.yp ]; then
  cp -a etc/rc.d/rc.yp etc/rc.d/rc.yp.new.incoming
  cat etc/rc.d/rc.yp.new > etc/rc.d/rc.yp.new.incoming
  mv etc/rc.d/rc.yp.new.incoming etc/rc.d/rc.yp.new
fi

config etc/nsswitch.conf-nis.new
config etc/netgroup.new
config etc/yp.conf.new
config etc/rc.d/rc.yp.new
config var/yp/nicknames.new
config var/yp/Makefile.new
config var/yp/securenets.new
rm -f etc/nsswitch.conf.new etc/nsswitch.conf-nis.new etc/netgroup.new etc/yp.conf.new var/yp/nicknames.new var/yp/Makefile.new var/yp/securenets.new
( cd usr/bin ; rm -rf ypchfn )
( cd usr/bin ; ln -sf yppasswd ypchfn )
( cd usr/bin ; rm -rf ypchsh )
( cd usr/bin ; ln -sf yppasswd ypchsh )
