3 for QUERY in `echo $QUERY_STRING | tr '&' ' '`; do
4 for VALUE in `echo $QUERY | tr '=' ' '`; do
5 if [ "$VALUE" == "id" ]; then
7 elif [ "$ID" == "?" ]; then
9 elif [ "$VALUE" == "power" ]; then
11 elif [ "$POWER" == "?" ]; then
18 UNIXSOCK=/var/run/powersensordaemon/cmd.sock
19 VALIDIDS="werkzeug stereo labor schreibtisch logo idee"
21 if [ "$POWER" == "on" -o "$POWER" == "off" ]; then
22 for CHECKID in $VALIDIDS; do
23 if [ "$CHECKID" == "$ID" ]; then
24 echo "power $POWER $ID" | usocket $UNIXSOCK
29 DESC_werkzeug="Beleuchtung Werkzeug"
30 DESC_stereo="Stereo Anlage"
31 DESC_labor="Labor Licht"
32 DESC_schreibtisch="Schreibtisch Licht"
36 echo "Content-type: text/html"
40 echo "<title>Realraum rf433ctl</title>"
43 echo "<h1>Realraum rf433ctl</h1>"
45 echo " <tr><th>Device</th><th>ON</th><th>OFF</th></tr>"
46 for DISPID in $VALIDIDS; do
47 NAME="$(eval echo \$DESC_$DISPID)"
48 [ -z "$NAME" ] && NAME=$DISPID
49 echo " <tr><td>$NAME</td><td><a href=\"switch.cgi?id=$DISPID&power=on\">ON</a></td><td><a href=\"switch.cgi?id=$DISPID&power=off\">OFF</a></td></tr>"