aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/lm_sensors/lmsensors/sensord.init
blob: 5a09cd3cfcb6f3f0b298430177216e28aab7ebc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#! /bin/sh
### BEGIN INIT INFO
# Provides:          sensord
# Required-Start:    $local_fs
# Should-Start:
# Required-Stop:     $local_fs
# Should-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: sensord initscript
# Description:       Starts the sensord logging daemon
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin

DESC="sensors logging daemon"
NAME="sensord"
SENSORD=`which $NAME`

. /etc/init.d/functions || exit 1
. /etc/sensord.conf || exit 1

# Exit if the package is not installed
[ -x "$SENSORD" ] || exit 0

case "$1" in
    start)
        echo -n "Starting $DESC: $NAME... "
        start-stop-daemon -S -x $SENSORD -- $SENSORD_ARGS
        echo "done."
        ;;
    stop)
        echo -n "Stopping $DESC: $NAME... "
        start-stop-daemon -K -x $SENSORD
        echo "done."
        ;;
    restart)
        echo "Restarting $DESC: $NAME... "
        $0 stop
        $0 start
        echo "done."
        ;;
    *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac

exit 0