Automatic commit
[breezed.git] / install.sh
1 #!/bin/bash
2
3 #  breezed is a fan speed control daemon for Linux computers.
4 #
5 #  Copyright (c) 2008 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 make -k
23
24 if [[ ! -a "/etc/breezed.conf" ]]; then
25     echo "You have to copy one of the breezed_*.conf file in /etc/breezed.conf"
26     echo "before installing the daemon."
27     exit 0
28 fi
29
30 cp ./breezed /usr/local/bin/
31 cp ./breezed.sh /etc/init.d/
32
33 if [[ -d "/usr/lib/pm-utils/sleep.d/" ]]; then
34     cp ./breezed-pm-utils.sh /usr/lib/pm-utils/sleep.d/50breezed
35 else
36     echo "I can not find /usr/lib/pm-utils/sleep.d/"
37     echo "On Debian, you should install pm-utils"
38 fi
39
40 cp ./breezed.1 /usr/share/man/man1/
41
42 update-rc.d breezed.sh defaults
43
44 /etc/init.d/breezed.sh start