Channel Changing Script Not Accurate in Mythtv.

For discussion of topics specific to MythTV on linux
Post Reply
boukmandutty
Newcomer
Posts: 2
Joined: Sat May 23, 2015 4:06 am
United States of America

Channel Changing Script Not Accurate in Mythtv.

Post by boukmandutty »

Can anyone offer any insight into why this script does work as well in mythtv as it does when i execute it from the shell? Mythtv is set to invoke it whenever a recording starts but it ends up skipping past the channels I set. When i execute the command from the shell it is flawless. I am wondering if there is something in the code that is throwing mythtv off.
#!/bin/bash
IPAD=192.168.1.131
RESTART= [Command to start andriod tv application goes here]; sleep 10;"
OK="input keyevent DPAD_CENTER"

#FX
if [ $1 = 10248 ]

then
adb -s $IPAD shell $RESTART "input keyevent DPAD_CENTER"
fi

#FS1
if [ $1 = 10219 ]
then
adb -s $IPAD shell $RESTART "input keyevent DPAD_RIGHT; sleep 1; $OK"
fi

#NBCSN
if [ $1 = 10220 ]
then
adb -s $IPAD shell $RESTART "input keyevent DPAD_RIGHT DPAD_RIGHT; sleep1; $OK"
fi
Like I said it works perfectly when run it from the shell but when I set it as a system event mythtv just doesn't execute it accurately. I wondering if it has to do with the fact that I am invoking adb.
User avatar
heyted
Senior
Posts: 301
Joined: Sun Jun 08, 2014 2:14 am
Location: South Florida
Contact:
United States of America

Re: Channel Changing Script Not Accurate in Mythtv.

Post by heyted »

Copy it to /tmp/.
Open a terminal.
sudo su mythtv
/tmp/thisscript.sh
exit

If the above does not work, then it's something to do with MythTV running the script as the mythtv user.
Ted | My blog
Post Reply