summaryrefslogtreecommitdiff
blob: 69150df28247f6a9a6bb1449f0f45b536386bd0d (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
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-laptop/laptop-mode-tools/files/laptop-mode-tools-1.08-init.d,v 1.1 2005/08/08 17:24:39 brix Exp $

checkconfig() {
    if [ ! -f /proc/sys/vm/laptop_mode ]; then
		eerror "Kernel does not support laptop_mode"
		return 1
    fi
}

start() {
    checkconfig || return 1

    ebegin "Starting laptop_mode"
    touch /var/run/laptop-mode-enabled && /usr/sbin/laptop_mode auto &> /dev/null
    eend $?
}

stop() {
    ebegin "Stopping laptop_mode"
    /usr/sbin/laptop_mode stop &> /dev/null && rm -f /var/run/laptop-mode-enabled
    eend $?
}