#!/bin/sh for QUERY in `echo $QUERY_STRING | tr '&' ' '`; do for VALUE in `echo $QUERY | tr '=' ' '`; do if [ "$VALUE" == "id" ]; then ID='?' elif [ "$ID" == "?" ]; then ID=$VALUE elif [ "$VALUE" == "power" ]; then POWER='?' elif [ "$POWER" == "?" ]; then POWER=$VALUE elif [ "$VALUE" == "mobile" ]; then MOBILE='1' NOFLOAT='1' elif [ "$VALUE" == "nofloat" ]; then NOFLOAT='1' fi i=$i+1 done done UNIXSOCK=/var/run/powersensordaemon/cmd.sock VALID_ONOFF_IDS="regalleinwand labortisch bluebar couchred couchwhite all lichter ambientlights cxleds mashadecke boiler" VALID_SEND_IDS_CUSTOM_DISPLAY="ymhpoweroff ymhpower ymhvolup ymhvoldown" VALID_SEND_IDS="ymhpoweron ymhcd ymhwdtv ymhtuner ymhaux ymhsattv ymhvolmute ymhmenu ymhplus ymhminus ymhtest ymhtimelevel ymheffect ymhprgup ymhprgdown ymhtunplus ymhtunminus ymhtunabcde ymhtape ymhvcr ymhextdec ymhsleep ymhp5 panicled blueled moviemode" #VALID_BANSHEE_IDS="playPause next prev" #VALID_CAM_MOTOR_IDS="c C w W" [ "$POWER" == "send" ] && POWER=on if [ "$POWER" == "on" -o "$POWER" == "off" ]; then for CHECKID in $VALID_ONOFF_IDS $VALID_SEND_IDS $VALID_SEND_IDS_CUSTOM_DISPLAY; do if [ "$CHECKID" == "$ID" ]; then echo "power $POWER $ID" | usocket $UNIXSOCK echo "Content-type: text/html" echo "" echo "" echo "
" echo "