#!/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.fuse.new


###
# Use rc.local to start fuse at boot.
###

# if rc.hal is executable, run it on startup
run=`grep ". /etc/rc.d/rc.fuse" etc/rc.d/rc.local`
if [[ "${run}" == "" ]]; then
cat << EOF >> etc/rc.d/rc.local

#Fuse
# To disable Fuse, chmod rc.fuse to 644
if [ -x /etc/rc.d/rc.fuse ]; then
	sh /etc/rc.d/rc.fuse start
fi
EOF
fi


( cd usr/lib ; rm -rf libfuse.so.2 )
( cd usr/lib ; ln -sf libfuse.so.2.6.3 libfuse.so.2 )
( cd usr/lib ; rm -rf libfuse.so )
( cd usr/lib ; ln -sf libfuse.so.2.6.3 libfuse.so )
( cd usr/lib ; rm -rf libulockmgr.so.1 )
( cd usr/lib ; ln -sf libulockmgr.so.1.0.1 libulockmgr.so.1 )
( cd usr/lib ; rm -rf libulockmgr.so )
( cd usr/lib ; ln -sf libulockmgr.so.1.0.1 libulockmgr.so )
