LinHES Forums
http://forum.linhes.org/

change_channel.csh correct scripting?
http://forum.linhes.org/viewtopic.php?f=2&t=1433
Page 1 of 1

Author:  elgordo123 [ Thu May 13, 2004 1:00 am ]
Post subject:  change_channel.csh correct scripting?

I can switch to a command line (or ssh) and run
/usr/local/bin/change_channel.csh 248
(or any channel)
and it will change to the right channel.

however I guess I don't know the right script to put in the mythtv "external channel change command" box.
I have
/usr/local/bin/change_channel.csh
also tried with %1 at end, %2 at end $1, etc.
Probably need to find out what exactly to put there.
Here is my change_channel.csh file:
#!/bin/csh
echo "changing to $1"
/usr/local/bin/channel.pl $1 &


Here is my channel.pl file:
#!/usr/bin/perl
#
## make sure to set this string to
## the corresponding remote in /etc/lircd.conf
$remote_name = "JVC_RAW";

sub change_channel {
my($channel_digit) = @_;
system ("remote_irsend SEND_ONCE $remote_name $channel_digit");
sleep 1;
}

$channel=$ARGV[0];
sleep 1;
if (length($channel) > 2) {
change_channel(substr($channel,0,1));
change_channel(substr($channel,1,1));
change_channel(substr($channel,2,1));
} elsif (length($channel) > 1) {
change_channel(substr($channel,0,1));
change_channel(substr($channel,1,1));
} else {
change_channel(substr($channel,0,1));
}
system ("remote_irsend SEND_ONCE $remote_name SELECT");


Thanks in advance...

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/