From cb63ccb7ff33d9cb3a58d3b877be17725742e234 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Mon, 28 Feb 2011 21:15:24 +0000 Subject: [PATCH] lightlevel direclty from slug to http --- powersensordaemon/lightlevel.cgi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 powersensordaemon/lightlevel.cgi diff --git a/powersensordaemon/lightlevel.cgi b/powersensordaemon/lightlevel.cgi new file mode 100755 index 0000000..0b031af --- /dev/null +++ b/powersensordaemon/lightlevel.cgi @@ -0,0 +1,14 @@ +#!/bin/sh +UNIXSOCK=/var/run/powersensordaemon/cmd.sock +TMPFILE=$(mktemp) +echo "sample photo0" | usocket $UNIXSOCK -n > $TMPFILE & +PID=$! +echo "Content-type: text/html" +echo "" +while [ ! -s $TMPFILE ]; do + continue +done +cat $TMPFILE | cut -d' ' -f 2 +rm $TMPFILE +kill $PID +exit 0 -- 1.7.10.4