#!/sbin/runscript # Copyright 1999-2006 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.init,v 1.2 2006/11/14 08:05:50 uberlord Exp $ opts="${opts} reload" depend() { use localmount after bootmisc } 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 init >/dev/null eend $? } stop() { ebegin "Stopping laptop_mode" rm -f /var/run/laptop-mode-enabled /usr/sbin/laptop_mode stop init >/dev/null eend $? } reload() { if ! service_started "${SVCNAME}" ; then eerror "${SVCNAME} has not yet been started" return 1 fi ebegin "Reloading laptop_mode" /usr/sbin/laptop_mode auto init force >/dev/null eend $? } # vim: set ts=4 :