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
#!/bin/bash

#export SDL_NOMOUSE=1
export LD_LIBRARY_PATH=/usr/lib32:/usr/lib:/mnt/vendor/lib

ACT="/tmp/.next"
CMD="/mnt/vendor/bin/dmenu.bin"
MISCBIN="/mnt/mmc/dmenu.bin"

#add debug for product
if [ -f "/mnt/sdcard/debug.ini" ];then
	MISCBIN="/mnt/sdcard/dmenu.bin"
fi

#add for video
if [ -f "/tmp/vpRun.ini" ];then
	MISCBIN="/mnt/vendor/bin/video/vp.dge"
fi

if [ -f  $MISCBIN ]
then
	CMD=$MISCBIN
fi

#touch "$ACT"

function app_scheduling()
{
	if $CMD > /dev/null 2>&1; then
		if [ -f "$ACT" ]; then
			if  ! sh $ACT > /dev/null 2>&1; then
	#           sleep 5
				echo "[allenapp] exe app fail ..."
			fi
	#        rm -f "$ACT"
		fi
	else
		sleep 30
	fi
}

function debug_app_scheduling()
{
	if $CMD > /dev/console 2>&1; then
		if [ -f "$ACT" ]; then
			if  ! sh $ACT > /dev/console 2>&1; then
	#           sleep 5
				echo "[allenapp] exe app fail ..." > /dev/console
			fi
	#        rm -f "$ACT"
		fi
	else
		sleep 30
	fi
}

if [ -f "/mnt/data/debug.ini" ];then
	debug_app_scheduling
elif [ -f "/mnt/sdcard/debug.ini" ];then
	debug_app_scheduling
else
	app_scheduling
fi