#!/bin/sh # # sensors This shell script takes care of starting and stopping # sensord. # # description: sensors is a sensors daemon which can be used to alert you in the # event of a hardware health monitoring alarm # # chkconfig: 2345 05 97 # Source function library. . /etc/rc.d/init.d/functions # Check that networking is up. [ -f /usr/sbin/sensord ] || exit 0 [ -f /usr/bin/sensors ] || exit 0 # See how we were called. case "$1" in start) # Set Alarm sensors -s && sleep 2 # Start daemons. echo -n "Starting sensord: " daemon sensord -i 1m -l 30m echo touch /var/lock/subsys/sensors ;; stop) # Stop daemons. echo -n "Shutting down sensord: " killproc sensord echo rm -f /var/lock/subsys/sensors ;; status) status sensord ;; restart|reload) $0 stop $0 start ;; condrestart) [ -e /var/lock/subsys/sensors ] && $0 restart || : ;; *) echo "Usage: sensors {start|stop|restart|reload|status}" exit 1 esac exit 0