PageRenderTime 105ms CodeModel.GetById 102ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 1ms

/init.d/lm-sensors

http://github.com/brinkman83/bashrc
Shell | 46 lines | 30 code | 6 blank | 10 comment | 3 complexity | 6d41433f50565eedb8696451dc3311b0 MD5 | raw file
 1#!/bin/sh
 2
 3### BEGIN INIT INFO
 4# Provides:          lm-sensors
 5# Required-Start:    $remote_fs
 6# Required-Stop:
 7# Default-Start:     S
 8# Default-Stop:
 9# Short-Description: lm-sensors
10# Description:       hardware health monitoring
11### END INIT INFO
12
13. /lib/lsb/init-functions
14
15[ -f /etc/default/rcS ] && . /etc/default/rcS
16PATH=/bin:/usr/bin:/sbin:/usr/sbin
17PROGRAM=/usr/bin/sensors
18
19test -x $PROGRAM || exit 0
20
21case "$1" in
22  start)
23	log_begin_msg "Setting sensors limits"
24	if [ "$VERBOSE" = "no" ]; then
25		/usr/bin/sensors -s 1> /dev/null 2> /dev/null
26		/usr/bin/sensors 1> /dev/null 2> /dev/null
27	else
28		/usr/bin/sensors -s
29		/usr/bin/sensors > /dev/null
30	fi
31	log_end_msg 0
32	;;
33  stop)
34	;;
35  force-reload|restart)
36	$0 start
37	;;
38  status)
39	exit 0
40	;;
41  *)
42	log_success_msg "Usage: /etc/init.d/sensors {start|stop|restart|force-reload|status}"
43	exit 1
44esac
45
46exit 0