27 lines
554 B
Plaintext
Executable File
27 lines
554 B
Plaintext
Executable File
#!/sbin/openrc-run
|
|
name="homemade_speedstep"
|
|
description="crude imitation of intel's speedstep"
|
|
command=/usr/bin/homemade_speedstep
|
|
command_args="${HSMAXTEMP} ${HSMINTEMP}"
|
|
command_background=true
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
|
|
checkconfig() {
|
|
if [ ${HSMAXTEMP} -lt 100000 ] && [ ${HSMINTEMP} -lt ${HSMAXTEMP} ] ; then
|
|
return 0
|
|
fi
|
|
}
|
|
|
|
start_pre() {
|
|
# Prevent of double check
|
|
if [ "${RC_CMD}" != "restart" ] ; then
|
|
checkconfig || return $?
|
|
fi
|
|
}
|
|
|
|
stop_pre() {
|
|
if [ "${RC_CMD}" = "restart" ] ; then
|
|
checkconfig || return $?
|
|
fi
|
|
}
|