Typo.
[breezed.git] / breezed.sh
1 #!/bin/bash
2
3 #  breezed is a fan speed control daemon for Linux computers.
4 #
5 #  Copyright (c) 2008, 2009 Francois Fleuret
6 #  Written by Francois Fleuret <francois@fleuret.org>
7 #
8 #  This file is part of breezed.
9 #
10 #  breezed is free software: you can redistribute it and/or modify it
11 #  under the terms of the GNU General Public License version 3 as
12 #  published by the Free Software Foundation.
13 #
14 #  breezed is distributed in the hope that it will be useful, but
15 #  WITHOUT ANY WARRANTY; without even the implied warranty of
16 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 #  General Public License for more details.
18 #
19 #  You should have received a copy of the GNU General Public License
20 #  along with breezed.  If not, see <http://www.gnu.org/licenses/>.
21
22 ### BEGIN INIT INFO
23 # Provides:          breezed
24 # Required-Start:
25 # Required-Stop:
26 # Default-Start:     2 3 4 5
27 # Default-Stop:      0 1 6
28 # Short-Description: Fan control daemon
29 ### END INIT INFO
30
31 DAEMON="/usr/bin/breezed"
32 CONF_FILE="/etc/breezed.conf"
33
34 test -x $DAEMON || exit 0
35
36 . /lib/lsb/init-functions
37
38 case "$1" in
39
40     start)
41         if [[ -f "${CONF_FILE}" ]]; then
42             log_daemon_msg "Starting fan control daemon" "breezed"
43             start-stop-daemon --start --background --quiet \
44                 --make-pidfile --pidfile /var/run/breezed.pid \
45                 --exec ${DAEMON}
46             log_end_msg $?
47         else
48             log_failure_msg "Can not find ${CONF_FILE}."
49         fi
50         ;;
51
52     restart)
53         $0 stop
54         $0 start
55         ;;
56
57     stop)
58         log_daemon_msg "Stopping fan control daemon" "breezed"
59         start-stop-daemon --stop --quiet \
60             --pidfile /var/run/breezed.pid
61         log_end_msg $?
62         ;;
63
64     *)
65         echo "Usage: breezed.sh [start|restart|stop]" >&2
66         exit 3
67         ;;
68 esac
69
70 ######################################################################