
config() {
 NEW="$1"
 OLD="$(dirname $NEW)/$(basename $NEW .new)"
 if [ ! -r $OLD ] ; then
  mv $NEW $OLD
  echo ""
  echo "  --> Installed new configuration file $OLD"
 elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ] ; then
  rm $NEW
 else
  echo ""
  echo "  --> Installed new configuration file $NEW"
  echo "  --> Preserving your old configuration file $OLD"
  echo ""
  echo "  Please examine your existing configuration file: $OLD"
  echo "  to see if it needs to be updated from: $NEW"
  echo ""
 fi
}

config etc/rc.d/rc.autorun.new

if  [ "$(grep rc.autorun /etc/rc.d/rc.local |grep -v '^#')" = "" ] ; then
	echo "  --> Adding an entry to /etc/rc.d/rc.local for /etc/rc.d/rc.autorun"
	echo ""
	echo "# Start autorun service" >> /etc/rc.d/rc.local
	echo "if [ -x /etc/rc.d/rc.autorun ] ; then" >> /etc/rc.d/rc.local
	echo "  . /etc/rc.d/rc.autorun start" >> /etc/rc.d/rc.local
	echo "fi" >> /etc/rc.d/rc.local
	echo "" >> /etc/rc.d/rc.local
fi


# update the applications menu database
if [ -x /usr/bin/update-desktop-database ] ; then
 /usr/bin/update-desktop-database /usr/share/applications >/dev/null
fi

