blob: d24a70ab9873c220835765a0bae95a84a917c00e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
if [ -z "$DISPLAY" ] && [ ! -f /tmp/_nox_ ] \
&& echo $(tty) | grep "tty1" &>/dev/null; then
startx
# Maybe there should be some code here to handle a failed startx?
# The 'return' value is at /tmp/xlogout
# If there is nothing there, switch user to 'newuser'
# If there is also nothing there, login as root
# - if already root, fall through to terminal
if [ -f /tmp/xlogout ] || [ -f /tmp/newuser ]; then
logout
elif [ ${UID} -ne 0 ]; then
echo "root" >/tmp/newuser
logout
fi
fi
|