#!/bin/sh # Generated by lircconfig at lircconfig.commandir.com # Mon Jun 9 4:12:39 MDT 2008 for bcjenkins if [ $# -lt 3 ] then echo "chchange.sh version 2.3 chchange.sh is a channel changing script typically used with media programs like MythTV. Usage: $0 REMOTE_NAME TRANSMITTER_NUM (CHANNEL_NUMBER | IR_COMMAND) [DELAY] Options REMOTE_NAME the name of one of your remotes TRANSMITTER_NUM the emitter number attached to the REMOTE_NAME device (1-16) CHANNEL_NUMBER the channel number to send IR_COMMAND any IR command on REMOTE_NAME that is not a number DELAY time to wait beween IR commands (default 0.2s) " exit 1 fi if [ $# -eq 4 ] then DELAY=$4 else DELAY=.2 fi LOCKFILE=/tmp/lirclock export PATH=/bin:/usr/bin:/usr/local/bin REMOTE_NAME=$1 TRANSMITTER=$2 cmd="$3" while [ -f $LOCKFILE ] do #echo "Waiting for lock..." sleep .1 done touch $LOCKFILE irsend SET_TRANSMITTERS $TRANSMITTER sleep .15 case $cmd in [0-9]*) for digit in $(echo $3 | sed -e 's/./& /g'); do irsend SEND_ONCE $REMOTE_NAME $digit sleep $DELAY done ;; *) irsend SEND_ONCE $REMOTE_NAME $cmd ;; esac rm $LOCKFILE