Subversion Repositories livecd

Rev

Rev 1 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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