summaryrefslogtreecommitdiff
path: root/packages/temper/files/init
diff options
context:
space:
mode:
authorTim 'timtim' Ellis <tim.ellis@foonas.org>2009-01-23 19:07:42 +0000
committerTim 'timtim' Ellis <tim.ellis@foonas.org>2009-01-23 19:07:42 +0000
commitf100ce481378316dae03c2d72f060d897bd37b01 (patch)
treef70d277f4e0c6129af55efb5e5caff5703b43e8c /packages/temper/files/init
parentc914f8705032943d8cb2d8504ab7473fa98194cc (diff)
temper: Add init script before my n1200 melts.
Diffstat (limited to 'packages/temper/files/init')
-rw-r--r--packages/temper/files/init32
1 files changed, 32 insertions, 0 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