diff options
Diffstat (limited to 'app-laptop/laptop-mode-tools/files/laptop-mode-tools-1.06-init.d')
-rw-r--r-- | app-laptop/laptop-mode-tools/files/laptop-mode-tools-1.06-init.d | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app-laptop/laptop-mode-tools/files/laptop-mode-tools-1.06-init.d b/app-laptop/laptop-mode-tools/files/laptop-mode-tools-1.06-init.d new file mode 100644 index 000000000000..59793f9ce546 --- /dev/null +++ b/app-laptop/laptop-mode-tools/files/laptop-mode-tools-1.06-init.d @@ -0,0 +1,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.06-init.d,v 1.1 2005/07/29 09:24:33 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 $? +} |