4.5.0r6
[enigma2.git] / usr / bin / enigma2-system-state
1 #!/bin/sh
2 if [ -f /run/enigma2/system-state ]; then
3         state=`cat /run/enigma2/system-state`
4         case "$state" in
5                 "system-restart")
6                         if [ -f /proc/stb/fp/force_restart ]; then
7                                 echo 1 > /proc/stb/fp/force_restart
8                                 systemctl --no-block poweroff
9                         else
10                                 systemctl --no-block reboot
11                         fi
12                         ;;
13                 "system-standby")
14                         systemctl --no-block poweroff
15                         ;;
16                 "ui-restart")
17                         ;;
18                 "system-recovery")
19                         if [ -f /proc/stb/fp/boot_mode ]; then
20                                 echo "rescue" > /proc/stb/fp/boot_mode
21                                 systemctl --no-block reboot
22                         else
23                                 to-the-rescue
24                         fi
25                         ;;
26         esac
27         rm -f /run/enigma2/system-state
28 fi