#!/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 "Realraum rf433ctl" echo '' echo "" exit 0 fi done for CHECKID in $VALID_BANSHEE_IDS; do if [ "$CHECKID" == "$ID" ]; then echo "$ID/" | nc wuerfel.realraum.at 8484 echo "Content-type: text/html" echo "" echo "" echo "" echo "Realraum rf433ctl" echo '' echo "" exit 0 fi done for CHECKID in $VALID_CAM_MOTOR_IDS; do if [ "$CHECKID" == "$ID" ]; then echo "$ID" > /dev/ttyACM0 echo "Content-type: text/html" echo "" echo "" echo "" echo "Realraum rf433ctl" echo '' echo "" exit 0 fi done fi DESC_regalleinwand="LEDs Regal Leinwand" DESC_bluebar="Blaue LEDs Bar" DESC_labortisch="Labortisch" DESC_couchred="LEDs Couch Red" DESC_couchwhite="LEDS Couch White" DESC_cxleds="CX Leds" DESC_mashadecke="MaSha Decke" DESC_ambientlights="Ambient Lichter" DESC_boiler="Warmwasser Küche" DESC_lichter="Alle Lichter" DESC_all="Alles" DESC_ymhpoweron="Receiver On (off+tgl)" DESC_ymhpoweroff="Receiver Off" DESC_ymhpower="Receiver On/Off" DESC_ymhvolup="VolumeUp" DESC_ymhvoldown="VolumeDown" DESC_ymhcd="Input CD" DESC_ymhwdtv="Input S/PDIF Wuerfel" DESC_ymhtuner="Input Tuner" DESC_ymhvolmute="Mute" DESC_ymhmenu="Menu" DESC_ymhplus="+" DESC_ymhminus="-" DESC_ymhtest="Test" DESC_ymhtimelevel="Time/Levels" DESC_ymheffect="DSP Effect Toggle" DESC_ymhprgup="DSP Up" DESC_ymhprgdown="DSP Down" DESC_ymhtunplus="Tuner +" DESC_ymhtunminus="Tuner -" DESC_ymhtunabcde="Tuner ABCDE" DESC_ymhtape="Tape" DESC_ymhvcr="VCR" DESC_ymhextdec="ExtDec Toggle" DESC_seep="Sleep Modus" DESC_panicled="HAL9000 says hi" DESC_blueled="Blue Led" DESC_moviemode="Movie Mode" DESC_w="Cam >" DESC_W="Cam >>" DESC_c="Cam <" DESC_C="Cam <<" echo "Content-type: text/html" echo "" echo "" echo "" echo "Realraum rf433ctl" echo '' [ "$NOFLOAT" == "1" ] && tail -n+67 /www/ymhremote.html | head -n 37 echo '' echo "" echo "" #echo "

Realraum rf433ctl

" #echo "
" echo "
" echo "
" for DISPID in $VALID_ONOFF_IDS; do NAME="$(eval echo \$DESC_$DISPID)" [ -z "$NAME" ] && NAME=$DISPID echo "
" echo "" echo " " echo " " echo "" echo "
$NAME
" echo "
" if [ "$NOFLOAT" == "1" ]; then echo "
" fi done #Custom Buttons Start echo "
" echo "" echo " " echo " " echo "" echo "
Receiver Power
" echo "
" if [ "$NOFLOAT" == "1" ]; then echo "
" fi echo "
" echo "" echo " " echo " " echo "" echo "
Receiver Volume
" echo "
" if [ "$NOFLOAT" == "1" ]; then echo "
" fi #Custom Buttons End echo "
" if [ "$MOBILE" != "1" ]; then echo "
" ITEMCOUNT=0 for DISPID in $VALID_SEND_IDS; do ITEMCOUNT=$((ITEMCOUNT+1)) NAME="$(eval echo \$DESC_$DISPID)" [ -z "$NAME" ] && NAME=$DISPID echo "
" echo "" echo " " echo "" echo "
$NAME
" echo "
" if [ "$NOFLOAT" == "1" -a $((ITEMCOUNT % 2 )) -ne 1 ]; then echo "
" fi done echo '' echo "
" if [ "$NOFLOAT" == "1" ]; then echo "
" tail -n+107 /www/ymhremote.html | head -n 5 echo "
" fi echo "
" for DISPID in $VALID_BANSHEE_IDS $VALID_CAM_MOTOR_IDS; do NAME="$(eval echo \$DESC_$DISPID)" [ -z "$NAME" ] && NAME=$DISPID echo "
" echo "" echo " " echo "" echo "
$NAME
" echo "
" if [ "$NOFLOAT" == "1" ]; then echo "
" fi done echo "
" fi echo "
" echo "" echo ""