From: Andrew Ruthven Date: Fri, 11 Apr 2008 02:42:37 +0000 (+1200) Subject: Add scripts to return if MythTV is recording now or soon. X-Git-Tag: 0.7.4~12 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4f630c439d7c62118e6df462051e73bd766d552;p=mythtv-status.git Add scripts to return if MythTV is recording now or 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