merge of '49118a4c6035353c0f8cf1aa30297dd36e43241f'
[vuplus_openembedded] / packages / lcd4linux / files / lcd4linux.init
1 #! /bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides:          lcd4linux
5 # Required-Start:
6 # Required-Stop:
7 # Default-Start:     2 3 4 5
8 # Default-Stop:      0 1 6
9 # Short-Description: daemon for driving LCD based displays
10 # Description:       LCD4Linux is a small program that grabs information from
11 #                    the kernel and some subsystems and displays it on an
12 #                    external liquid crystal display.
13 ### END INIT INFO
14
15 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
16 DAEMON=/usr/bin/lcd4linux
17 NAME=lcd4linux
18 DESC=lcd4linux
19
20 test -x $DAEMON || exit 0
21 test -f /etc/lcd4linux.conf || exit 0
22
23 set -e
24
25 case "$1" in
26   start)
27         echo -n "Starting $DESC: "
28         chmod 600 /etc/lcd4linux.conf
29         start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
30                 --exec $DAEMON -- $DAEMON_OPTS
31         echo "$NAME."
32         ;;
33   stop)
34         echo -n "Stopping $DESC: "
35         start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
36                 --exec $DAEMON || true
37         echo "$NAME."
38         ;;
39   restart|force-reload)
40         echo -n "Restarting $DESC: "
41         start-stop-daemon --stop --quiet --pidfile \
42                 /var/run/$NAME.pid --exec $DAEMON
43         sleep 1
44         start-stop-daemon --start --quiet --pidfile \
45                 /var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
46         echo "$NAME."
47         ;;
48   *)
49         N=/etc/init.d/$NAME
50         # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
51         echo "Usage: $N {start|stop|restart|force-reload}" >&2
52         exit 1
53         ;;
54 esac
55
56 exit 0