#!/bin/ash
#exit
grep " nox" /proc/cmdline && return
#[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx >/dev/null
U(){
[ "`cat /etc/ld.so.conf.d/*.conf 2>/dev/null |egrep '^[^#]*/nvidia/'`" ] || return
echo -n "Wait /etc/rc.d/010-update-cache"
while true ;do
#    pgrep -f /etc/rc.d/010-update-cach >/dev/null || break
#    pidof ldconfig || break
#    pgrep -f update-cache >/dev/null || { echo -n ".OK ";echo ; break ; }
    pidof depmod ldconfig >/dev/null || { echo -n ".OK ";echo ; break ; }
     echo -n "." && sleep 1
done
}
#[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx >/dev/null
#	    [[ $(fgconsole 2>/dev/null) == 1 ]] &&  exec startx -- vt7 2>/dev/null
	    [[ $(fgconsole 2>/dev/null) == 1 ]] &&  { [ -e /usr/bin/systemctl ] ||  U ; exec startx -- vt7  2>/dev/null ; }

##	    [[ $(fgconsole 2>/dev/null) == 1 ]] &&  exec startx -- vt7 2>/dev/null
#	    [[ $(fgconsole 2>/dev/null) == 1 ]] &&  { [ -e /usr/bin/systemctl ] ||  U ; exec startx  2>/dev/null ; }
