#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header:$ # description: Starts and stops "laptop-mode" - tweaks system behavior # to extend battery life. # # config: /etc/laptop-mode/laptop-mode.conf # Based on original init.d script included in laptop-mode-tools package. # Ported to Gentoo by: Adrian Almenar depend() { use logger } checkconfig() { if [ ! -e /proc/sys/vm/laptop_mode ] ; then eerror "Laptop-mode support has not been compiled into the kernel" return 1 fi } start() { ebegin "Initializing laptop mode" touch /var/run/laptop-mode-enabled /usr/sbin/laptop_mode auto > /dev/null eend $? } stop() { ebegin "Stopping laptop mode" rm -f /var/run/laptop-mode-enabled /usr/sbin/laptop_mode stop > /dev/null eend $? }