diff options
author | Michał Masłowski <mtjm@mtjm.eu> | 2012-11-24 21:40:14 +0100 |
---|---|---|
committer | Michał Masłowski <mtjm@mtjm.eu> | 2012-11-24 21:40:14 +0100 |
commit | 76f02e67987546467ddcdb2d006533c9d8e791b5 (patch) | |
tree | d37f87dc372d83081faae5fc3e3e99c4d791ad18 /pcr/thinkfan/thinkfan | |
parent | 195c4578406bed02fbbb75e19abfb302d9a1f5fb (diff) |
New thinkfan on pcr.
Diffstat (limited to 'pcr/thinkfan/thinkfan')
-rw-r--r-- | pcr/thinkfan/thinkfan | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/pcr/thinkfan/thinkfan b/pcr/thinkfan/thinkfan new file mode 100644 index 000000000..d37c81424 --- /dev/null +++ b/pcr/thinkfan/thinkfan @@ -0,0 +1,54 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +test -f /usr/sbin/thinkfan || exit 0 + +case "$1" in + start) + stat_busy "Starting thinkfan" + /usr/sbin/thinkfan -- -q -s5 >/dev/null 2>&1 + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon thinkfan + stat_done + fi + ;; + stop) + stat_busy "Stopping thinkfan" + PID=$(</var/run/thinkfan.pid) + kill $PID + rm -f /var/run/thinkfan.pid + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon thinkfan + stat_done + fi + ;; + restart) + stat_busy "Restarting thinkfan" + + PID=$(</var/run/thinkfan.pid) + kill $PID + rm -f /var/run/thinkfan.pid + if [ $? -gt 0 ]; then + stat_fail + rm_daemon thinkfan + else + /usr/sbin/thinkfan -- -q -s5 >/dev/null 2>&1 + if [ $? -gt 0 ]; then + stat_fail + rm_daemon thinkfan + else + stat_done + fi + fi + ;; + *) + echo "Usage: $0 {stop|start|restart}" + ;; +esac +exit 0 |