#!/bin/sh # # Startup script for Fancontrol # # /etc/init.d/fancontrol # ### BEGIN INIT INFO # Provides: fancontrol # Required-Start: $sensors # Should-Start: sensors # Required-Stop: $sensors # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # description: Fancontrol is a shell script for use with lm_sensors. \ # It reads its configuration from a file, then calculates \ # fan speeds from temperatures and sets the corresponding \ # PWM outputs to the computed values. ### END INIT INFO # # By: oyaji . /etc/rc.status # Reset status of this service rc_reset FANCONTROL="/usr/sbin/fancontrol" PIDFILE="/var/run/fancontrol.pid" LOGFILE="/var/log/fancontrol.log" # See how we were called. case "$1" in start) echo -n "Starting fancontrol: " startproc -l $LOGFILE $FANCONTROL touch /var/lock/subsys/fancontrol rc_status -v ;; stop) echo -n "Shutting down fancontrol: " killproc fancontrol rm -f $PIDFILE rm -f /var/lock/subsys/fancontrol rc_status -v ;; status) echo -n "Checking status of fancontrol: " checkproc fancontrol rc_status -v ;; restart) $0 stop $0 start ;; *) echo -n "Usage: $0 {start|stop|restart|status}" exit 1 esac exit 0