summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/lm_sensors/files/rc')
-rw-r--r--sys-apps/lm_sensors/files/rc112
1 files changed, 0 insertions, 112 deletions
diff --git a/sys-apps/lm_sensors/files/rc b/sys-apps/lm_sensors/files/rc
deleted file mode 100644
index a8baed5c2539..000000000000
--- a/sys-apps/lm_sensors/files/rc
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/sbin/runscript
-
-start() {
- if ! [ -f /etc/conf.d/lm_sensors ] ; then
- eerror "/etc/conf.d/lm_sensors does not exist, try running sensors-detect"
- return 1
- fi
-
- . /etc/conf.d/lm_sensors
-
- if [ -z "${NOLOADMODULES}" ] ; then
- if [ -z "${MODULE_0}" ] ; then
- eerror "MODULE_0 is not set in /etc/conf.d/lm_sensors, try running sensors-detect"
- return 1
- fi
-
- einfo "Loading lm_sensors modules..."
-
- mount | grep sysfs &>/dev/null
- if [ $? == 0 ]; then
- if ! ( [ -e /sys/i2c ] || [ -e /sys/bus/i2c ] ); then
- ebegin " Loading i2c-core"
- modprobe i2c-core &>/dev/null
- if [ $? != 0 ]; then
- eerror " Could not load i2c-core!"
- eend 1
- fi
- ( [ -e /sys/i2c ] || [ -e /sys/bus/i2c ] ) || return 1
- eend 0
- fi
- elif ! [ -e /proc/sys/dev/sensors ]; then
- ebegin " Loading i2c-proc"
- modprobe i2c-proc &>/dev/null
- if [ $? != 0 ]; then
- eerror " Could not load i2c-proc!"
- eend 1
- fi
- [ -e /proc/sys/dev/sensors ] || return 1
- eend 0
- fi
-
- i=0
- while true; do
- module=`eval echo '$'MODULE_${i}`
- module_args=`eval echo '$'MODULE_${i}_ARGS`
- if [ -z "${module}" ] ; then
- break
- fi
- ebegin " Loading ${module}"
- modprobe ${module} ${module_args} &>/dev/null
- eend $?
- i=$((i+1))
- done
- fi
-
- if ! [ -f /etc/sensors.conf ] ; then
- eerror "/etc/sensors.conf does not exist!"
- return 1
- fi
-
- ebegin "Initializing sensors"
- /usr/bin/sensors -s &>/dev/null
- eend $?
-
- return 0
-}
-
-stop() {
- if ! [ -f /etc/conf.d/lm_sensors ] ; then
- eerror "/etc/conf.d/lm_sensors does not exist, try running sensors-detect"
- return 1
- fi
-
- . /etc/conf.d/lm_sensors
-
- if [ -z "${NOLOADMODULES}" ] ; then
- if [ -z "${MODULE_0}" ] ; then
- eerror "MODULE_0 is not set in /etc/conf.d/lm_sensors, try running sensors-detect"
- return 1
- fi
-
- ebegin "Removing lm_sensors modules"
- eend $?
-
- # find the highest possible MODULE_ number
- i=0
- while true; do
- module=`eval echo '$'MODULE_${i}`
- if [ -z "${module}" ] ; then
- break
- fi
- i=$((i+1))
- done
-
- while [ ${i} -gt 0 ]; do
- i=$((i-1))
- module=`eval echo '$'MODULE_${i}`
- ebegin " Removing ${module}"
- rmmod ${module} &>/dev/null
- eend $?
- done
-
- if [ -e /proc/sys/dev/sensors ] ; then
- ebegin " Removing i2c-proc"
- rmmod i2c-proc &>/dev/null
- eend $?
- fi
- fi
-
- return 0
-
-}