From 7c18b3644b69c6b1349d49aebdd578dce7eee215 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Sun, 21 Mar 2010 00:30:23 +0000 Subject: [PATCH] sample movement fix --- sensor_graph/sample_sensors.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sensor_graph/sample_sensors.sh b/sensor_graph/sample_sensors.sh index bc666fb..ed902d5 100755 --- a/sensor_graph/sample_sensors.sh +++ b/sensor_graph/sample_sensors.sh @@ -1,6 +1,10 @@ #!/bin/sh +sleep 2 echo -e "listen sensor\n" | usocket /var/run/powersensordaemon/cmd.sock -n | ./sample_sensor.lua &>/dev/null & -echo -e "listen movement\n" | usocket /var/run/powersensordaemon/cmd.sock -n > /tmp/movement.tmp & +PID1=$! +echo -e "listen movement\n" | usocket /var/run/powersensordaemon/cmd.sock -n >> /tmp/movement.tmp & +PID2=$! +trap "kill $PID1 $PID2" 0 while sleep 30; do L=$(wc -l /tmp/movement.tmp | cut -d' ' -f1) echo -n > /tmp/movement.tmp -- 1.7.10.4