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