Subversion Repositories livecd

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 beyerle@PS 1
#!/bin/bash
2
#
3
# autostart is execute at login 
4
# (executed by .xinitrc)
5
#
6
 
7
### source liblinuxlive
8
MOUNTDIR=livecd
9
. /$MOUNTDIR/live/liblinuxlive
10
 
11
### get run=... from kernel parameter
12
RUN=$( cmdline_value run )
13
 
14
### run not defined -> exit
15
if [ ! $RUN ]; then
16
    if [ -x /usr/bin/psi-menu ]; then
17
	/usr/bin/psi-menu &
18
    else
19
	xterm -geometry 100x30+100+100 &
20
    fi
21
fi
22
 
23
### functions
24
poweroff_system()
25
{
26
    Xdialog --yesno '\nShutdown your PC now ?\n' 0 0
27
    if [ "$?" = "0" ]; then
28
	poweroff
29
	sleep 20
30
    fi
31
}    
32
 
33
### rdesktop, afterwards ask to poweroff
34
if [ "$RUN" = "rdesktop" ]; then
35
    while [ "" = "" ]; do
36
	rdesktop $RDESKTOP_OPT -d PSICH -f -u win_username -a24 -x lan -r sound:local winterm1
37
	poweroff_system
38
    done
39
fi
40
 
41
### nx client, afterwards aks to poweroff
42
if [ "$RUN" = "nxclient" ]; then
43
    while [ "" = "" ]; do
44
	nxclient
45
	NXDOWN=""
46
	while [ ! $NXDOWN ]; do
47
	    sleep 1
48
	    ps wwaux | grep -v grep | grep -q nxssh
49
	    [ "$?" = "1" ] && NXDOWN=yes
50
	done
51
	killall nxclient
52
	poweroff_system
53
    done
54
fi
55
 
56
### start what is given by "run"
57
$RUN &