Merge branch 'obi/master'
[enigma2.git] / 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 if [ -d /home/root ]; then
11         cd /home/root
12 fi
13
14 LD_PRELOAD=@libdir@/libopen.so.0.0.0 @bindir@/enigma2
15
16 # enigma2 exit codes:
17 #
18 # 0 - restart enigma
19 # 1 - halt
20 # 2 - reboot
21 #
22 # >128 signal
23
24 ret=$?
25 case $ret in
26         1)
27                 /sbin/halt
28                 ;;
29         2)
30                 /sbin/reboot
31                 ;;
32         4)
33                 /sbin/rmmod lcd
34                 /usr/sbin/fpupgrade --upgrade 2>&1 | tee /home/root/fpupgrade.log
35                 sleep 1;
36                 /sbin/rmmod fp
37                 /sbin/modprobe fp
38                 /sbin/reboot
39                 ;;
40         *)
41                 ;;
42 esac