From: Bernhard Tittelbach Date: Mon, 28 Feb 2011 21:15:24 +0000 (+0000) Subject: lightlevel direclty from slug to http X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=cb63ccb7ff33d9cb3a58d3b877be17725742e234;p=svn42.git lightlevel direclty from slug to http --- 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