Code/ibm-fancontrol.init

From ThinkWiki
Jump to: navigation, search
  1. !/sbin/runscript
  2. 2005 Gilbert Tiefengruber
  3. Distributed under the terms of the GNU General Public License v2
  4. IBM Fancontrol init script for IBM Thinkpad laptops (tested with R50)
  5. This init script was written for gentoo 2005.1, kernel 2.6.12
  6. You need the ibm_acpi kernel module version 0.11 or greater
  7. load the module with experimental=1 to enable the fan controls

depend() {

       need localmount

} checkconfig() {

       if [ ! -e /proc/acpi/ibm/fan ]; then
               eerror "The ibm_acpi module must be loaded with (experimental=1)"
               return 1
       fi

} start() {

       checkconfig || return 1
       ebegin "Starting ibm-fancontrold"
       start-stop-daemon --quiet -p /var/run/ibm-fancontrold.pid -m -b --start -a /usr/sbin/ibm-fancontrold
       eend ${?}

} stop() {

       ebegin "Stopping ibm-fancontrold"
       start-stop-daemon --stop --quiet -p /var/run/ibm-fancontrold.pid
       eend ${?}

}