#!/bin/sh #----------------------------------------------------------------------------- # /var/install/bin/lm_sensors-redetect - sensors detection # # Creation: 2005-05-26 Vsevolod Kukol # Last update: $Id$ # # Copyright (c) 2005 Vsevolod Kukol # Copyright (c) 2009-2012 Holger Bruenje, holgerbruenjes(at)gmx(dot)net # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- # read eislib . /var/install/include/eislib # set packages name package_name=lm_sensors exec 2>/tmp/lm-sensors-trace$$.log set -x clrhome /etc/init.d/${package_name} stop mecho --info "Detecting sensors..." echo mecho --warn "ATTENTION!!!" mecho --warn "We will now try to detect installed chips and sensors." mecho --warn "After the recognition /etc/sysconfig/lm_sensors has to be created" mecho --warn "(type yes when asked!) to be able to load all required modules." mecho --warn "Please read the following information(s) carefully to avoid errors!" echo anykey /usr/sbin/sensors-detect if [ ! -f /etc/sysconfig/lm_sensors ] then mecho --warn "/etc/sysconfig/lm_sensors not found!" mecho --warn "use '(Re)detect Hardware' or /usr/sbin/sensors-detect" mecho --warn "to create /etc/sysconfig/lm_sensors" else mecho --info "/etc/sysconfig/lm_sensors created successfully" fi # remove new-install file rm -rf /var/lib/${package_name} echo anykey get_chips () { mod_list="/etc/sysconfig/lm_sensors" if [ -f "${mod_list}" ] then grep -E "^MODULE_" ${mod_list} >/tmp/_module_list$$ while read line do modul=$(echo ${line} | cut -d "=" -f 2) if [ -z "${module_list}" ] then module_list="${modul}" module_list_dialog="${modul}" else module_list="${module_list}|"${modul} module_list_dialog="${module_list_dialog},"${modul} fi done /etc/check.d/${package_name}.exp cat >>/etc/check.d/${package_name}.exp <