summaryrefslogtreecommitdiff
blob: 6fb6a17657024f36c086c13117394a318b3fb5ec (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.05.init,v 1.1 2005/04/11 19:22:58 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 $?
}