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

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

# Initialize kudzu.
[ -x /usr/sbin/kudzu ] && /usr/sbin/kudzu -q

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

# 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
}

# perform charset conversions for some translation files if needed
{
	touch /usr/share/locale/*/LC_MESSAGES
	for i in /etc/cron.hourly/mdk_convert_translations* ; do
		[ -r "$i" ] && nice -20 /bin/sh $i 2>> $FLO
	done
} &

# Set the mixer to 80%
if egrep -q '(sparcaudio|sound)' /proc/devices 2>/dev/null && [ -x /usr/bin/aumix ];then
    /usr/bin/aumix -v80 -w80 -c80 2>/dev/null >/dev/null || :
fi

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

# Finish
rm -f /var/lock/TMP_1ST
