[mythtv-users] Query backend status

Jan Ceuleers jan.ceuleers at gmail.com
Mon May 5 05:13:25 UTC 2014


On 05/04/2014 10:29 PM, R Kannan wrote:
> @Hika:  I'd like to write a shell script that will automatically update the
> system when mythbackend is idle (not recording, and no mythfrontend usage).

Here is some inspiration for you:

#!/bin/bash
nc fe3 6546 -i 1 > /tmp/frontendStatus.out <<EOS
query location
quit
EOS

! tail -2 < /tmp/frontendStatus.out | grep -e "# Playback" > /dev/null

What this shows is how to ask a frontend what it's doing. This
particular script is only interested in the Playback state, but more
options are available:

http://www.mythtv.org/wiki/Frontend_control_socket

Jan


More information about the mythtv-users mailing list