#!/usr/local/bin/bash
NOAUTOLOGIN=/etc/sysconfig/noautologin
if [ -f "$NOAUTOLOGIN" ]; then
	if [ -s "$NOAUTOLOGIN" ]; then
		> "$NOAUTOLOGIN"
		exit
	fi
else
	if [ ! -f /etc/sysconfig/superuser ]; then 
		clear
		TCUSER="$(cat /etc/sysconfig/tcuser)"
		exec /bin/login -f "$TCUSER"
	fi
fi

#modprobe k10temp
PS1="[\$(sensors| grep temp1 | head -c 21 | tail -c 7)][\u@\h:\w]\$ "

MOUNTED=0                                                                                                                              
echo -n 'waiting for USB being mounted .'                                                                                              
                                                                                                                                       
while [ $MOUNTED -eq 0 ]                                                                                                               
do                                                                                                                                     
        sleep 1                                                                                                                        
        echo -n '.'                                                                                                                    
        MOUNTED=`mount | grep TINYCORE | wc -l`                                                                                        
done                                                                                                                                   
echo

#/usr/local/bin/bash /media/TINYCORE/autostart.sh
cd /media/TINYCORE 
. /media/TINYCORE/autostart.sh

