#!/sbin/runscript
# Copyright 1999-2003 Robert Gogolok
# Distributed under the terms of the GNU General Public License v2
# email: robertgogolok@web.de
# ------
# Please email me if you have suggestions how to improve this ebuild
# or when you need help to install it.

DAEMON=/usr/sbin/cpufreqd

depend() {
	need localmount
}

checkconfig() {
	if [ ! -e /proc/cpufreq -a ! -e /sys/devices/system/cpu/cpu0/cpufreq ] ; then
	
		eerror "CPUFreq support has not been compiled into the kernel"
		return 1
	fi
}

start() {
	checkconfig || return 1
	ebegin "Starting cpufreqd"
	start-stop-daemon --start --quiet --exec $DAEMON
	eend $?
}

stop() {
	ebegin "Stopping cpufreqd"
	start-stop-daemon --stop --quiet --exec $DAEMON
	eend $?
}

reload() {
	ebegin "Reloading cpufreq configuration"
	start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
	eend $?
}

