#!/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/rc.d/rc.saslauthd.new
( cd usr/lib ; rm -rf libsasl2.so )
( cd usr/lib ; ln -sf libsasl2.so.3.0.0 libsasl2.so )
( cd usr/lib ; rm -rf libsasl2.so.3 )
( cd usr/lib ; ln -sf libsasl2.so.3.0.0 libsasl2.so.3 )
( cd usr/lib/sasl2 ; rm -rf libcrammd5.so )
( cd usr/lib/sasl2 ; ln -sf libcrammd5.so.3.0.0 libcrammd5.so )
( cd usr/lib/sasl2 ; rm -rf libcrammd5.so.3 )
( cd usr/lib/sasl2 ; ln -sf libcrammd5.so.3.0.0 libcrammd5.so.3 )
( cd usr/lib/sasl2 ; rm -rf libdigestmd5.so )
( cd usr/lib/sasl2 ; ln -sf libdigestmd5.so.3.0.0 libdigestmd5.so )
( cd usr/lib/sasl2 ; rm -rf libdigestmd5.so.3 )
( cd usr/lib/sasl2 ; ln -sf libdigestmd5.so.3.0.0 libdigestmd5.so.3 )
( cd usr/lib/sasl2 ; rm -rf libgs2.so )
( cd usr/lib/sasl2 ; ln -sf libgs2.so.3.0.0 libgs2.so )
( cd usr/lib/sasl2 ; rm -rf libgs2.so.3 )
( cd usr/lib/sasl2 ; ln -sf libgs2.so.3.0.0 libgs2.so.3 )
( cd usr/lib/sasl2 ; rm -rf libgssapiv2.so )
( cd usr/lib/sasl2 ; ln -sf libgssapiv2.so.3.0.0 libgssapiv2.so )
( cd usr/lib/sasl2 ; rm -rf libgssapiv2.so.3 )
( cd usr/lib/sasl2 ; ln -sf libgssapiv2.so.3.0.0 libgssapiv2.so.3 )
( cd usr/lib/sasl2 ; rm -rf liblogin.so )
( cd usr/lib/sasl2 ; ln -sf liblogin.so.3.0.0 liblogin.so )
( cd usr/lib/sasl2 ; rm -rf liblogin.so.3 )
( cd usr/lib/sasl2 ; ln -sf liblogin.so.3.0.0 liblogin.so.3 )
( cd usr/lib/sasl2 ; rm -rf libotp.so )
( cd usr/lib/sasl2 ; ln -sf libotp.so.3.0.0 libotp.so )
( cd usr/lib/sasl2 ; rm -rf libotp.so.3 )
( cd usr/lib/sasl2 ; ln -sf libotp.so.3.0.0 libotp.so.3 )
( cd usr/lib/sasl2 ; rm -rf libplain.so )
( cd usr/lib/sasl2 ; ln -sf libplain.so.3.0.0 libplain.so )
( cd usr/lib/sasl2 ; rm -rf libplain.so.3 )
( cd usr/lib/sasl2 ; ln -sf libplain.so.3.0.0 libplain.so.3 )
( cd usr/lib/sasl2 ; rm -rf libsasldb.so )
( cd usr/lib/sasl2 ; ln -sf libsasldb.so.3.0.0 libsasldb.so )
( cd usr/lib/sasl2 ; rm -rf libsasldb.so.3 )
( cd usr/lib/sasl2 ; ln -sf libsasldb.so.3.0.0 libsasldb.so.3 )
( cd usr/lib/sasl2 ; rm -rf libscram.so )
( cd usr/lib/sasl2 ; ln -sf libscram.so.3.0.0 libscram.so )
( cd usr/lib/sasl2 ; rm -rf libscram.so.3 )
( cd usr/lib/sasl2 ; ln -sf libscram.so.3.0.0 libscram.so.3 )
( cd usr/lib/sasl2 ; rm -rf libsql.so )
( cd usr/lib/sasl2 ; ln -sf libsql.so.3.0.0 libsql.so )
( cd usr/lib/sasl2 ; rm -rf libsql.so.3 )
( cd usr/lib/sasl2 ; ln -sf libsql.so.3.0.0 libsql.so.3 )
