From d4f630c439d7c62118e6df462051e73bd766d552 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Fri, 11 Apr 2008 14:42:37 +1200 Subject: [PATCH] Add scripts to return if MythTV is recording now or soon. --- bin/mythtv_recording_now | 25 +++++++++++++++++++++++++ bin/mythtv_recording_soon | 26 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 bin/mythtv_recording_now create mode 100755 bin/mythtv_recording_soon diff --git a/bin/mythtv_recording_now b/bin/mythtv_recording_now new file mode 100755 index 0000000..5211665 --- /dev/null +++ b/bin/mythtv_recording_now @@ -0,0 +1,25 @@ +#!/bin/sh +# Copyright (c) 2007 Andrew Ruthven +# This code is hereby licensed for public consumption under the GNU GPL v2. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# Return an exit code of 0 if the MythTV backend is currently recording +# a show. + +# Where Debian stores the config info. +if [ -f /etc/default/mythtv-status ] +then + . /etc/default/mythtv-status +fi + +/usr/bin/mythtv-status -h ${HOST:=localhost} --return-code-only --recording-now + +if [ $? -eq 1 ] +then + exit 0 +else + exit 1 +fi diff --git a/bin/mythtv_recording_soon b/bin/mythtv_recording_soon new file mode 100755 index 0000000..b3198b5 --- /dev/null +++ b/bin/mythtv_recording_soon @@ -0,0 +1,26 @@ +#!/bin/sh +# Copyright (c) 2007 Andrew Ruthven +# This code is hereby licensed for public consumption under the GNU GPL v2. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# Return an exit code of 0 if the MythTV backend is currently recording +# a show or will be recording a show soon (in the next hour). + +# Where Debian stores the config info. +if [ -f /etc/default/mythtv-status ] +then + . /etc/default/mythtv-status +fi + +/usr/bin/mythtv-status -h ${HOST:=localhost} --return-code-only \ + --recording-now --next-recording + +if [ $? -eq 1 ] +then + exit 0 +else + exit 1 +fi -- 2.30.2