summaryrefslogtreecommitdiff
path: root/packages/temper
diff options
context:
space:
mode:
Diffstat (limited to 'packages/temper')
-rw-r--r--packages/temper/files/init32
-rw-r--r--packages/temper/temper_0.0.1.bb12
2 files changed, 41 insertions, 3 deletions
diff --git a/packages/temper/files/init b/packages/temper/files/init
new file mode 100644
index 0000000000..a5307205cb
--- /dev/null
+++ b/packages/temper/files/init
@@ -0,0 +1,32 @@
+#! /bin/sh
+# temper - simple init.d temper fan control script - tim.ellis@foonas.org
+set -e
+
+if [ ! -f /usr/sbin/temper ]; then
+ echo -n "Warning: temper fan control script not found. Shutting down"
+ shutdown -h now
+ exit -1
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting temper: "
+ start-stop-daemon -S -b -n temper -a /usr/sbin/temper
+ echo "done"
+ ;;
+ stop)
+ echo -n "Stopping temper: "
+ start-stop-daemon -K -n temper >&- 2>&- &
+ echo "done"
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: temper { start | stop | restart }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/packages/temper/temper_0.0.1.bb b/packages/temper/temper_0.0.1.bb
index ce4bed0b4a..2d6679dc9b 100644
--- a/packages/temper/temper_0.0.1.bb
+++ b/packages/temper/temper_0.0.1.bb
@@ -1,13 +1,19 @@
DESCRIPTION = "A fan control script for the Thecus n1200 or n2100"
SECTION = "console/network"
-PR = "r0"
+PR = "r1"
LICENSE = "GPL"
COMPATIBLE_MACHINE = "(n1200|n2100)"
RDEPENDS = "hddtemp"
-SRC_URI = "file://temper"
+SRC_URI = "file://temper \
+ file://init"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "temper"
+INITSCRIPT_PARAMS = "defaults"
do_install() {
- install -d ${D}/usr/sbin
install -D -m 0755 ${WORKDIR}/temper ${D}/usr/sbin/temper
+ install -D -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/temper
}