Support turbo2.
[vuplus_dvbapp] / tools / enigma2.sh.in
1 #!/bin/sh
2
3 prefix=@prefix@
4 exec_prefix=@exec_prefix@
5 datarootdir=@datarootdir@
6
7 if [ -x @bindir@/showiframe -a -f @datadir@/backdrop.mvi ]; then
8         @bindir@/showiframe @datadir@/backdrop.mvi
9 fi
10
11 # hook to execute scripts always before enigma2 start
12 if [ -x @bindir@/enigma2_pre_start.sh ]; then
13         @bindir@/enigma2_pre_start.sh
14 fi
15
16 if [ -d /home/root ]; then
17         cd /home/root
18 fi
19
20 LIBS=@libdir@/libopen.so.0.0.0
21
22 #check for dreambox specific passthrough helper lib
23 if [ -e @libdir@/libpassthrough.so ]; then
24         LIBS="$LIBS @libdir@/libpassthrough.so"
25 fi
26
27 LD_PRELOAD=$LIBS @bindir@/enigma2
28
29 # enigma2 exit codes:
30 #
31 # 0 - restart enigma
32 # 1 - halt
33 # 2 - reboot
34 #
35 # >128 signal
36
37 ret=$?
38 case $ret in
39         1)
40                 /sbin/halt
41                 ;;
42         2)
43                 /sbin/reboot
44                 ;;
45         4)
46                 /sbin/rmmod lcd
47                 /usr/sbin/fpupgrade --upgrade 2>&1 | tee /home/root/fpupgrade.log
48                 sleep 1;
49                 /sbin/rmmod fp
50                 /sbin/modprobe fp
51                 /sbin/reboot
52                 ;;
53         *)
54                 ;;
55 esac