DirecTV http channel changing

Help with using MiniMyth (except Booting)

Moderator: Pablo

Post Reply
gregoliver
New Member
Posts: 2
Joined: Sat Sep 25, 2010 3:47 pm

DirecTV http channel changing

Post by gregoliver » Sun Sep 23, 2012 5:38 am

The latest version of .25-2.2-81 is missing the LWP perl requirements for HTTP::request, etc..

If you are like me and change a bunch of H* or HR* tuner's channels relying on that old dtv.pl script, you can copy this in it's place since netcat is installed in minimyth:

Code: Select all

#!/bin/bash

result=$(echo -ne "GET /tv/tune?major=$4 HTTP/1.0\r\n\r\n"|nc $1 8080 |grep msg|awk -F ":" '{print $2}')
if [[ "$(echo $result)" =~ "OK" ]]; then
	sleep 2
	return 0
else
	echo FAIL
	return 1
fi
It has been working for me today since I upgraded. I should have written it long ago - it is so much simpler than loading up all the perl modules from bash everytime I need to change the channel anyway.

Enjoy.

gregoliver
New Member
Posts: 2
Joined: Sat Sep 25, 2010 3:47 pm

Re: DirecTV http channel changing

Post by gregoliver » Mon Sep 24, 2012 6:13 pm

Actually, I forgot it was busybox, therefore:

Code: Select all

#!/bin/bash

result=$(echo -ne "GET /tv/tune?major=$4 HTTP/1.0\r\n\r\n"|nc $1 8080 |grep msg|awk -F ":" '{print $2}')
result=$(echo $result|sed 's/"//g')
result=$(echo $result|sed 's/\.//g')
result=$(echo $result|sed 's/\,//g')
if [ "$(echo $result)" == "OK" ]; then
        sleep 2
else
        exit 1
fi

Works for me.

Pablo
Site Admin
Posts: 4182
Joined: Tue Dec 14, 2004 2:13 am
Location: La Jolla
Contact:

Re: DirecTV http channel changing

Post by Pablo » Sat Dec 22, 2012 4:55 am

I suggest that you use a different shebang. As you noted, MiniMyth uses busybox. In particularly, it uses bash's ash shell. Therefore, I suggest the shebang be #!/bin/sh.
MiniMyth running on an Acer ApireRevo 3610 and a Zotac ZBOX-ID80-U. Find out more at my MythTV page.

Post Reply