Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -----------------------------------------------------------------------
- chchannels1.sh
- -----------------------------------------------------------------------
- #!/bin/sh
- # Maintained by CommandIR Support mini at commandir.com - Comments /
- Suggestions Welcome.
- # Modified - Mark Sept 2012
- LOCKFILE=/tmp/lirclock
- export PATH=/bin:/usr/bin:/usr/local/bin
- REMOTE_NAME=DCT2000
- TRANSMITTER=1
- . /usr/local/bin/config.sh
- if [ $# -lt 1 ]
- then
- echo "IR Control Script for LIRC V2.0
- Includes support for CommandIR transmitter selection and lockfile.
- Usage:
- $0 (CHANNEL_NUMBER | IR_COMMAND)
- Sends an IR command or sequence of numbers using REMOTE_NAME via emitter
- TRANSMITTER_NUM. DELAY (in seconds) is waited between sending IR commands.
- Example: Change to channel 123 using emitter $TRANSMITTER
- $0 123
- "
- exit 1
- fi
- cmd="$1"
- while [ -f $LOCKFILE ]
- do
- #echo "Waiting for lock..."
- sleep .1
- done
- touch $LOCKFILE
- irsend SET_TRANSMITTERS $TRANSMITTER
- sleep $PAUSE
- case $cmd in
- [0-9]*)
- for digit in $(echo $cmd | sed -e 's/./& /g'); do
- irsend SEND_ONCE $REMOTE_NAME $digit
- sleep $DELAY
- done
- ;;
- *)
- #irsend SEND_ONCE $REMOTE_NAME $cmd
- ;;
- esac
- rm $LOCKFILE
- -----------------------------------------------------------------------
- config.sh
- -----------------------------------------------------------------------
- #!/bin/sh
- #
- # Config parameters for all channel scripts
- #
- PAUSE=2.0
- DELAY=0.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement