Subversion Repositories livecd

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 beyerle@PS 1
#!/bin/bash
2
#
3
# Prepares for automatically login to icewm
4
# runs at the end of /etc/init.d/runlast
5
# (at the moment only for Mini LiveCD)
6
#
7
# Urs Beyerle, PSI
8
#
9
 
10
### definitions
11
 
12
# dir of mounted live system: /$MOUNTDIR/live
13
MOUNTDIR=livecd
14
 
15
# source functions
16
. /$MOUNTDIR/live/liblinuxlive
17
 
18
# PSI setup?
19
PSI=$( cmdline_parameter psi )
20
 
21
# no local user?
22
NOLOCAL=$( cmdline_parameter nolocal )
23
 
24
# set local user name
25
if [ $PSI ]; then
26
    LOCALUSER=l_psi
27
else
28
    LOCALUSER=sluser
29
fi
30
 
31
 
32
### create .xinitrc for LOCALUSER and root
33
XINITRC=/root/.xinitrc
34
echo "[ -x ~/autostart ] && ~/autostart" > $XINITRC
35
echo "[ ! -x ~/autostart ] && xterm -geometry 100x30+100+100 &" >> $XINITRC
36
echo "exec icewm-session" >> $XINITRC
37
chmod 755 $XINITRC
38
[ ! $NOLOCAL ] && cp -a $XINITRC /home/$LOCALUSER/
39
[ ! $NOLOCAL ] && chown $LOCALUSER /home/$LOCALUSER/.xinitrc
40
 
41
### link .xsession to .xinitrc
42
ln -sf .xinitrc /root/.xsession
43
[ ! $NOLOCAL ] && ln -sf .xinitrc /home/$LOCALUSER/.xsession
44
 
45
### run startx  (over .bashrc) at autotlogin of LOCALUSER
46
# autologin is done by /etc/inittab
47
[ ! $NOLOCAL ] && echo 'if [ "$( tty )" = "/dev/tty6" ]; then startx; fi' >> /home/$LOCALUSER/.bashrc