summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaik Schreiber <blizzy@gentoo.org>2002-08-04 00:24:45 +0000
committerMaik Schreiber <blizzy@gentoo.org>2002-08-04 00:24:45 +0000
commit269513473682b72a17dd855345d256615d66d24a (patch)
tree2289623ba9a65290ad3ac9a6b259f00c8114e8c5 /sys-apps/lm_sensors/files
parentAdd patch. (diff)
downloadhistorical-269513473682b72a17dd855345d256615d66d24a.tar.gz
historical-269513473682b72a17dd855345d256615d66d24a.tar.bz2
historical-269513473682b72a17dd855345d256615d66d24a.zip
added startup script
Diffstat (limited to 'sys-apps/lm_sensors/files')
-rw-r--r--sys-apps/lm_sensors/files/rc_lm_sensors30
1 files changed, 30 insertions, 0 deletions
diff --git a/sys-apps/lm_sensors/files/rc_lm_sensors b/sys-apps/lm_sensors/files/rc_lm_sensors
new file mode 100644
index 000000000000..697b572888a9
--- /dev/null
+++ b/sys-apps/lm_sensors/files/rc_lm_sensors
@@ -0,0 +1,30 @@
+#!/sbin/runscript
+
+start() {
+ if ! [ -f /etc/sysconfig/lm_sensors ] ; then
+ eerror "/etc/sysconfig/lm_sensors does not exist"
+ return 1
+ fi
+
+ . /etc/sysconfig/lm_sensors
+
+ ebegin "Loading lm_sensors modules"
+ eend $?
+ if ! [ -e /proc/sys/dev/sensors ] ; then
+ ebegin " Loading i2c-proc"
+ modprobe i2c-proc &>/dev/null
+ eend $?
+ fi
+ [ -e /proc/sys/dev/sensors ] || return 1
+
+ modules=`grep \^MODULE_ /etc/sysconfig/lm_sensors |wc -l`
+ i=1
+ while [ ${i} -le ${modules} ] ; do
+ module=`eval echo '$'MODULE_${i}`
+ ebegin " Loading ${module}"
+ modprobe ${module} &>/dev/null
+ eend $?
+ i=$((i+1))
+ done
+ return 0
+}