#!/bin/bash
# Description: Launch diverses Mandrake Scripts on boot.
# (c) MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>
# 	$Id: mandrake_everytime,v 1.7 2001/02/20 10:31:26 chmouel Exp $	

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

[ -e /etc/sysconfig/system ] && . /etc/sysconfig/system

# Build KdmSession
#[ -x /usr/sbin/fndSession ] && {
#       action "Building Window Manager Sessions" /usr/sbin/fndSession
#}

## OPTIMIZED BY WP

# Disabling supermount if not here
#if [[ $(uname -m) != sparc*  ]];then
#    if grep -q '^\/.*supermount.*' /etc/fstab && \
#	! grep -q '[[:space:]]supermount$' /proc/filesystems  && \
#	! modprobe -n supermount >/dev/null 2>/dev/null && [ -x /usr/bin/perl ];then
#	action "Disabling Supermount" /usr/sbin/supermount -i disable
#    fi
#fi

#Clean up Tmp.
if [ -n "$CLEAN_TMP" ] && [ "$CLEAN_TMP" -ge 1 ];then
    ( 
	TEXPR="! -ctime -$CLEAN_TMP"
	echo -n "Subere temporres Verzeichnis (/tmp): "
	cd /tmp && \
	    find . -xdev \
	    $TEXPR \
	    ! -name . \
	    ! \( -name lost+found -uid 0 \) \
	    ! \( -name quota.user -uid 0 \) \
	    ! \( -name quota.group -uid 0 \) \
	    -depth -exec rm -rf -- {} \; 
       	if [ "$?" = "0" ];then echo_success;else echo_failed;fi
	echo
    )
    rm -f /tmp/.X*-lock
    rm -f /tmp/esrv*
    rm -f /tmp/kio*
    rm -rf /tmp/.esd*
    rm -rf /tmp/orbit-*
    rm -rf /tmp/ssh-*
    rm -rf /tmp/ksocket-*
fi

# check if /etc/resolv.conf exist - if not creates it
[ -f /etc/resolv.conf ] || {
               touch /etc/resolv.conf
}

# check if /mnt/cdrom , /mnt/floppy and /mnt/disk are here - if not create them
#[ -d /mnt/cdrom ] || {
#       action "Creating /mnt/cdrom" mkdir -p /mnt/cdrom
#}

#[ -d /mnt/floppy ] || {
#     action "Creating /mnt/floppy" mkdir -p /mnt/floppy
#}

#[ -d /mnt/disk ] || {
#    action "Creating /mnt/disk" mkdir -p /mnt/disk
#}

# Now that we have all of our basic modules loaded and the kernel going,
# let's dump the syslog ring somewhere so we can find it later
dmesg > /var/log/dmesg
