summaryrefslogtreecommitdiffstats
path: root/build_tools/l7/larch0/profiles/xmini/rootoverlay/etc/X11/xinit/startx.custom
diff options
context:
space:
mode:
authorCecil Hugh Watson <knoppmyth@gmail.com>2010-08-28 21:23:23 (GMT)
committerCecil Hugh Watson <knoppmyth@gmail.com>2010-08-28 21:23:23 (GMT)
commitf83117d46d8fc1f6192783371a68607a192c3276 (patch)
tree21bf30aeb943fe6cb23eb9c62a0ba899de2af0d7 /build_tools/l7/larch0/profiles/xmini/rootoverlay/etc/X11/xinit/startx.custom
parent69a0137390be9816d5ec5dc9e81d48817a817758 (diff)
downloadlinhes_dev-f83117d46d8fc1f6192783371a68607a192c3276.zip
Larch 7
Diffstat (limited to 'build_tools/l7/larch0/profiles/xmini/rootoverlay/etc/X11/xinit/startx.custom')
-rw-r--r--build_tools/l7/larch0/profiles/xmini/rootoverlay/etc/X11/xinit/startx.custom18
1 files changed, 18 insertions, 0 deletions
diff --git a/build_tools/l7/larch0/profiles/xmini/rootoverlay/etc/X11/xinit/startx.custom b/build_tools/l7/larch0/profiles/xmini/rootoverlay/etc/X11/xinit/startx.custom
new file mode 100644
index 0000000..d24a70a
--- /dev/null
+++ b/build_tools/l7/larch0/profiles/xmini/rootoverlay/etc/X11/xinit/startx.custom
@@ -0,0 +1,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