Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- i="0"
- while [ $i -lt 1 ]
- do
- read varSTDIN
- case $varSTDIN in
- Version?)
- echo "OK:1.0" >&2
- ;;
- IsOpen?)
- echo "OK:Open" >&2
- ;;
- CloseRecorder)
- echo "OK:Terminating" >&2
- i="1"
- ;;
- HasTuner?)
- echo "OK:Yes" >&2
- ;;
- XON)
- echo "OK" >&2
- ;;
- XOFF)
- echo "OK" >&2
- ;;
- SignalStrengthPercent?)
- echo "OK:100" >&2
- ;;
- HasLock?)
- echo "OK:Yes" >&2
- ;;
- FlowControl?)
- echo "OK:XON/XOFF" >&2
- ;;
- LockTimeout?)
- echo "OK:9000" >&2
- ;;
- StartStreaming)
- echo "OK:Started" >&2
- ffmpeg -hide_banner -loglevel panic -rtsp_transport tcp -i rtsp://192.168.1.168:554/hdmi -codec copy -f mpegts - &
- ffmpeg_pid=$!
- ;;
- StopStreaming)
- kill $ffmpeg_pid
- echo "OK:Stopped" >&2
- ;;
- TuneChannel*)
- ChanID="${varSTDIN:12}"
- echo "OK:Changing Channel to $ChanID" >&2
- echo "changing channel to $ChanID" >> greglog
- if [ ${#ChanID} -eq 4 ]; then
- irsend SEND_ONCE blaster KEY_`expr substr $ChanID 1 1`
- irsend SEND_ONCE blaster KEY_`expr substr $ChanID 2 1`
- irsend SEND_ONCE blaster KEY_`expr substr $ChanID 3 1`
- irsend SEND_ONCE blaster KEY_`expr substr $ChanID 4 1`
- else
- irsend SEND_ONCE blaster KEY_`expr substr $ChanID 1 1`
- irsend SEND_ONCE blaster KEY_`expr substr $ChanID 2 1`
- irsend SEND_ONCE blaster KEY_`expr substr $ChanID 3 1`
- fi
- ;;
- HasPictureAttributes?)
- echo "OK:No" >&2
- ;;
- BlockSize*)
- echo "OK" >&2
- ;;
- esac
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement