#!/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/sudoers.new
rm -f etc/sudoers.new
( cd usr/bin ; rm -rf sudoedit )
( cd usr/bin ; ln -sf sudo sudoedit )
( cd usr/libexec/sudo ; rm -rf libsudo_util.so )
( cd usr/libexec/sudo ; ln -sf libsudo_util.so.0.0.0 libsudo_util.so )
( cd usr/libexec/sudo ; rm -rf libsudo_util.so.0 )
( cd usr/libexec/sudo ; ln -sf libsudo_util.so.0.0.0 libsudo_util.so.0 )
( cd usr/man/man8 ; rm -rf sudoedit.8.gz )
( cd usr/man/man8 ; ln -sf sudo.8.gz sudoedit.8.gz )
