summaryrefslogtreecommitdiffstats
path: root/abs/extra-testing/hddtemp/hddtemp
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-06-15 05:02:44 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-06-15 05:02:44 (GMT)
commit3f8de6887bc6ca2aa2e22a59d7fe93cccaa3a26f (patch)
treea1184fa24fe7a4e5e21b429a8dcfbaadd0d85dcd /abs/extra-testing/hddtemp/hddtemp
parent0d311999efc8d9c40436985772a799559c218d04 (diff)
downloadlinhes_pkgbuild-3f8de6887bc6ca2aa2e22a59d7fe93cccaa3a26f.zip
linhes_pkgbuild-3f8de6887bc6ca2aa2e22a59d7fe93cccaa3a26f.tar.gz
linhes_pkgbuild-3f8de6887bc6ca2aa2e22a59d7fe93cccaa3a26f.tar.bz2
hddtemp: add to repo
ref FS#146
Diffstat (limited to 'abs/extra-testing/hddtemp/hddtemp')
-rw-r--r--abs/extra-testing/hddtemp/hddtemp39
1 files changed, 39 insertions, 0 deletions
diff --git a/abs/extra-testing/hddtemp/hddtemp b/abs/extra-testing/hddtemp/hddtemp
new file mode 100644
index 0000000..62f0908
--- /dev/null
+++ b/abs/extra-testing/hddtemp/hddtemp
@@ -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