diff options
author | Joshua I. Haase H. (xihh) <hahj87@gmail.com> | 2012-09-18 23:41:48 -0500 |
---|---|---|
committer | Joshua I. Haase H. (xihh) <hahj87@gmail.com> | 2012-09-18 23:41:48 -0500 |
commit | fa95bb04dbbc63d07b1f84fb8ce5272085097eb7 (patch) | |
tree | 09eb51305956e84dfb79aa89f5b99e595371c54d /extra/hddtemp/rc.d | |
parent | 6eefbbf4300e680dc93487c11a1ae35ee8299f06 (diff) | |
parent | 5a05be089c68617c86c9c555e63f2b0314451ebf (diff) |
Merge branch 'master' of gitpar:abslibre-mips64el
Diffstat (limited to 'extra/hddtemp/rc.d')
-rw-r--r-- | extra/hddtemp/rc.d | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/extra/hddtemp/rc.d b/extra/hddtemp/rc.d new file mode 100644 index 000000000..62f090808 --- /dev/null +++ b/extra/hddtemp/rc.d @@ -0,0 +1,39 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PARAMS= +DRIVES= +[ -f /etc/conf.d/hddtemp ] && . /etc/conf.d/hddtemp +PID=$(pidof -o %PPID /usr/sbin/hddtemp) +case "$1" in + start) + stat_busy "Starting HDDTemp" + [ -z "$PID" ] && /usr/sbin/hddtemp -d $PARAMS $DRIVES + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon hddtemp + stat_done + fi + ;; + stop) + stat_busy "Stopping HDDTemp" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon hddtemp + stat_done + fi + ;; + restart) + $0 stop + sleep 2 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 |