[mythtv-users] Checking power status of STB
Justin Alcorn
justin at jalcorn.net
Mon Nov 3 17:31:32 UTC 2014
On Mon, Nov 3, 2014 at 7:44 AM, Justin Alcorn <justin at jalcorn.net> wrote:
> On Fri, Oct 31, 2014 at 5:48 PM, Daryl McDonald <darylangela at gmail.com> wrote:
>>
>>
>> On Fri, Oct 31, 2014 at 4:11 PM, Tom Lichti <tom at redpepperracing.com> wrote:
>>>
>>> On Fri, Oct 31, 2014 at 3:47 PM, Justin Alcorn <justin at jalcorn.net> wrote:
>>>>
>>>> On Fri, Oct 31, 2014 at 3:43 PM, Andrew C. (AFPup) Stadt
>>>> <acstadt at stadt.ca> wrote:
>>>> >
>>>>
>>>> >> My setup: TWC with Cisco STB. Ubuntu 14.04.1 and MythTV 0.28
>>>> >>
Enhanced to check the mythweb status page and determine if the device
is actually recording....
#!/bin/bash
REMOTE_NAME=blaster
DEVICE=/dev/lircd
SLEEP_TIME="0.3"
WAIT_TIME="5"
STB="0_74"
VDEV="/dev/video0"
POWER="${STB}_KEY_POWER"
send () {
irsend --device=${DEVICE} SEND_ONCE ${REMOTE_NAME} ${STB}_${1}
sleep ${SLEEP_TIME}
}
count=0
until $( wget -o /dev/null -O - -- http://localhost/mythweb/status |
grep ${VDEV} | grep "not recording" > /dev/null );
do
echo "/dev/video0 is recording...waiting"
(( count++ ))
if [ ${count} -gt 1 ]
then
echo "Tried ${count} times, giving up...."
exit 1
fi
sleep 5
done
until $(timeout 2 dd if=${VDEV} of=/dev/null bs=4k count=1 1>/dev/null
2>/dev/null )
do
echo "Powering on STB"
send KEY_POWER
sleep ${WAIT_TIME}
done
for DIGIT in $(echo ${1} | sed -e 's/./& /g'); do
send KEY_${DIGIT}
done
More information about the mythtv-users
mailing list