[hbbtv] reduce CPU usage
[vuplus_openvuplus] / meta-openvuplus / recipes-vuplus / lcd4linux / files / lcd4linux.init
1 #!/bin/sh
2 #
3 # lcd4linux
4 #
5 PLUGINDIR="/usr/lib/enigma2/python/Plugins/Extensions/LCD4linux"
6 DAEMON=/usr/bin/lcd4linux
7 NICELEVEL="0"
8
9
10 daemon_start() {
11         if [ -f $PLUGINDIR/dpf$1.conf ]; then
12                 echo "Starting $DAEMON $1"
13                 start-stop-daemon --start --nicelevel $NICELEVEL --quiet --pidfile /var/run/lcd4linux$1.pid --exec $DAEMON -- -q -p /var/run/lcd4linux$1.pid -f $PLUGINDIR/dpf$1.conf
14         else
15                 echo $PLUGINDIR/dpf$1.conf nicht gefunden
16         fi
17 }
18 daemon_stop() {
19         if [ -f /var/run/lcd4linux$1.pid ]; then
20                 echo "Stopping $DAEMON $1"
21                 start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/lcd4linux$1.pid --exec $DAEMON
22                 sleep 2
23                 echo "LCD::backlight(0)" | $DAEMON -i -f $PLUGINDIR/dpf$1.conf
24         fi
25 }
26 daemon_reload() {
27         if [ -f /var/run/lcd4linux$1.pid ]; then
28                 start-stop-daemon --stop --signal 1 --quiet --pidfile /var/run/lcd4linux$1.pid --exec $DAEMON
29         fi
30 }
31
32
33 case "$1" in
34   start)
35                 daemon_start 1
36                 daemon_start 2
37         ;;
38         start1)
39                 daemon_start 1
40         ;;
41         start2)
42                 daemon_start 2
43         ;;
44   stop)
45                 daemon_stop 1
46                 daemon_stop 2
47         ;;
48   stop1)
49                 daemon_stop 1
50         ;;
51   stop2)
52                 daemon_stop 2
53         ;;
54   reload)
55                 daemon_reload 1
56                 daemon_reload 2
57   ;;
58   restart|force-reload)
59                 daemon_stop 1
60                 daemon_stop 2
61                 sleep 4
62                 daemon_start 1
63                 daemon_start 2
64         ;;
65   *)
66                 echo "Usage: $0 {start|stop|restart|reload|force-reload|start1|start2|stop1|stop2}" >&2
67                 exit 1
68         ;;
69 esac
70 exit 0