#!/bin/sh
# Description: Launch Mandrake Configuration for the first time.
# (c) MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>
# 	$Id$	

FLO=/var/log/first_boot_log
touch $FLO

. /etc/rc.d/init.d/functions

# If fail erase the temporary file
trap 'rm -f /var/lock/TMP_1ST' 1 2 3 15

# Build the whatis database
{
	for i in /etc/cron.weekly/makewhatis*.cron ; do 
		[ -r "$i" ] && nice -20 /bin/sh $i 2>> $FLO
	done
} &

#Rebuild Mozilla registry
# be sure that mozilla registry is ok
[ -x /usr/lib/mozilla/regxpcom ] && [ -x /usr/lib/mozilla/regchrome ] &&
{
 export LD_LIBRARY_PATH=/usr/lib/mozilla
 action "Building Mozilla registry" /usr/lib/mozilla/regxpcom 2>> $FLO
 action "Registering Mozilla chrome" /usr/lib/mozilla/regchrome 2>> $FLO
 unset LD_LIBRARY_PATH
}

# Next try to find the applications installed on system and give a nice entries
# in kde menus # TODO: Gnomefinder4root
[ -x /usr/sbin/kappfinder4root ] && {
 	action "Building your KDE menu" /usr/sbin/kappfinder4root 2>> $FLO
}

#
[ -s $FLO ] || rm -f $FLO

# Finish
rm -f /var/lock/TMP_1ST
