summaryrefslogtreecommitdiff
path: root/packages/piccontrol/files
diff options
context:
space:
mode:
authorTim 'timtim' Ellis <tim.ellis@foonas.org>2009-01-24 00:43:58 +0000
committerTim 'timtim' Ellis <tim.ellis@foonas.org>2009-01-24 00:43:58 +0000
commitb1777b1bdf7d5971397ac6615257af56eced2602 (patch)
tree45b5982f912daaa8f9836334b1ee94cd61fd2a2e /packages/piccontrol/files
parent1fae1769d399b1157bcb4318593cd24a2f6d45b4 (diff)
piccontrol: Add init script, tidy up
Diffstat (limited to 'packages/piccontrol/files')
-rw-r--r--packages/piccontrol/files/init37
-rw-r--r--packages/piccontrol/files/piccontrol-0.4.conf4
2 files changed, 39 insertions, 2 deletions
diff --git a/packages/piccontrol/files/init b/packages/piccontrol/files/init
new file mode 100644
index 0000000000..3f2e511183
--- /dev/null
+++ b/packages/piccontrol/files/init
@@ -0,0 +1,37 @@
+#! /bin/sh
+# piccontrol - simple init.d piccontrol script - tim.ellis@foonas.org
+set -e
+
+if [ ! -f /usr/sbin/piccontrol ]; then
+ echo -n "Warning: piccontrol binary not found. Shutting down"
+ shutdown -h now
+ exit -1
+fi
+
+case "$1" in
+ start)
+ echo -n "Starting piccontrol: "
+ rm -f /var/run/piccontrol.sock
+ start-stop-daemon -S -b -n piccontrol -a /usr/sbin/piccontrol -- -d
+ sleep 1
+ piccontrol statusled greenon
+ piccontrol powerled on
+ piccontrol buzzer short
+ echo "done"
+ ;;
+ stop)
+ echo -n "Stopping piccontrol: "
+ start-stop-daemon -K -n piccontrol >&- 2>&- &
+ echo "done"
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: piccontrol { start | stop | restart }" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/packages/piccontrol/files/piccontrol-0.4.conf b/packages/piccontrol/files/piccontrol-0.4.conf
index 2504d75c66..9d8bf31826 100644
--- a/packages/piccontrol/files/piccontrol-0.4.conf
+++ b/packages/piccontrol/files/piccontrol-0.4.conf
@@ -1,6 +1,6 @@
register("ts209")
-register("evdev", "/dev/event0",
+register("evdev", "/dev/input/event0",
116, "restart_button",
408, "media_button")
@@ -42,4 +42,4 @@ end
function media_button( time )
piccmd("usbled", "8hz")
-end \ No newline at end of file
+end