summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/MythVantage-system/startfrontend
blob: 3e994aa12002caf5492580e4e3466207ccd66f11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/bin/sh
. /etc/profile
. /etc/systemconfig
. /etc/X11/STBWINDOWMANAGER

xhost +local:
xhost +127.0.0.1
xset -dpms s off
export MALLOC_CHECK_=0
#killall -q -9 xsay &
#rm -rf /tmp/xsay* &

function lirc_check {
    lcmd=`irsend LIST   ""    ""   2>&1 `
    status=$?
    if [ $status = 0 ]
    then
        rc=0
    else
        echo $lcmd |grep -q  "Connection refused"
        status=$?
        if [ $status = 0 ]
        then
            echo "lirc_check: lircd is not running"
        else
            echo " lirc_check: lircd is running but no receiver found"
        fi
        rc=1
    fi
    return $rc
}




$STBWINDOWMANAGER &
keylaunch &
/usr/bin/tilda &
/usr/X11R6/bin/unclutter -root -idle 0 -jitter 400 -noevents  &
/usr/bin/xvattr -a XV_COLORKEY -v 0
/usr/bin/mtd &
/usr/bin/nvidia-settings -l
/usr/bin/nvidia-settings -a InitialPixmapPlacement=2


#if [ x$ncidclient = "x1" ]
#then
#	ncid --no-gui &
#fi

if [ -f /opt/vmware/bin32/vmware-user-wrapper ]
then
	/opt/vmware/bin32/vmware-user-wrapper &
fi

if [ x$ShowTips = "x1" ]
then
#   xsay -t 10 "Alt+h list shortcuts"
bash -c "sleep 6;osdClient.pl localhost 5000 'ALT+h for shortcuts:::SYS' "&

fi


#wait for lirc
if [ x$HostLircWait  = x1 ]
then
    lcheck=5
    lirc_check
    status=$?

    while [[ ! $status  =  0  && !  $lcheck = 0 ]]
    do
        bash -c "osdClient.pl localhost 5000 'Waiting on remote - $lcheck:::SYS' "&
        sudo sv restart lircd ; echo "restart lircd"
        sleep .5
        lirc_check
        status=$?
        lcheck=$((lcheck -  1))
    done


fi





if [ !  $SystemType = "Frontend_only" ]
then
  if [ ! -f ~/.configured ]
	then
 	autocard.py -g &
	MythVantage -b
	#0 yes
	#1 yes/autodetech
	#2  no
	STATUS=$?
	if [ ! $STATUS = 2 ]
	then
		/usr/bin/backend_control.sh stop BE 127.0.0.1
		/usr/bin/mythtv-setup
		/usr/bin/backend_control.sh start BE 127.0.0.1
	fi
        touch  ~/.configured
	fi
else
	#touch file for FE only(mythsmolt)
	touch  ~/.configured
fi


if [ x"$UseMythWelcome" = "x1" ]
then
	STARTCMD="/usr/bin/mythwelcome"
else
	STARTCMD="/usr/bin/mythfrontend -d"
fi

echo "====================================================================="
echo "Starting $STARTCMD"
#spawn fb to start mythsmolt
firstboot.sh &

while [ x = x ]
do
	if [ -f /tmp/nomfe ]
	then
		sleep 120
	else
		if [ -f /tmp/debug ]
		then

			echo "using gbd/debug"
			gdb /usr/bin/mythfrontend -x $MV_ROOT/mfegdbcommands.txt
			bash -c "osdClient.pl localhost 5000 'Restart: mdb.txt.mythfrontend:::SYS' "&
			mv gdb.txt gdb.txt.mythfrontend
			sleep 10

		else
			killall -9 irexec
			/usr/bin/irexec &
			$STARTCMD 2>&1
		fi
	fi
echo "_______________________________________________________"
done