]> git.etc.gen.nz Git - mythtv-status.git/commitdiff
Add a molly-guard check.
authorAndrew Ruthven <andrew@etc.gen.nz>
Sat, 19 Apr 2008 04:20:45 +0000 (16:20 +1200)
committerAndrew Ruthven <andrew@etc.gen.nz>
Sat, 19 Apr 2008 05:47:21 +0000 (17:47 +1200)
ChangeLog
debian/control
debian/install
molly-guard/mythtv-recording-soon [new file with mode: 0755]

index f75393b02c0e5390ac0bbc612eacf2ea7a58e47d..d72bfd2c890a59ff1f3a8c1f92eeadb1f832a5aa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2008-04-19     Andrew Ruthven
+       Add a molly-guard check
+
 2008-04-11     Andrew Ruthven
        Provide helper scripts that'll return true if the MythTV backend
        is:
index b546e26f00d8ce4d4aaf14be347cfab235013dfe..9a80f158c496a8d6f82aad383a422807b922c264 100644 (file)
@@ -11,7 +11,7 @@ Vcs-Browser: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?p=mythtv-status.git;a=summ
 Package: mythtv-status
 Architecture: all
 Depends: ${misc:Depends}, ${perl:Depends}, libwww-perl, libxml-libxml-perl, libdate-manip-perl, libmime-perl
-Suggests: libmythtv-perl
+Suggests: libmythtv-perl, molly-guard (>= 0.3.3-1)
 Description: Show the status of a MythTV backend
  Shows the current status of a local or remote MythTV backend and up to
  the next 10 recordings for today and tomorrow.
index 5064406a6f02e79ce1f81dc327982171b44b4ff0..7eaaa8cbde50972ebc6c0b8dd126abab73a7ba49 100644 (file)
@@ -1,3 +1,4 @@
 bin/mythtv-status usr/bin
 bin/mythtv_recording_now usr/bin
 bin/mythtv_recording_soon usr/bin
+molly-guard/mythtv-recording-soon usr/share/molly-guard/checks.d/40-mythtv-recording-now
diff --git a/molly-guard/mythtv-recording-soon b/molly-guard/mythtv-recording-soon
new file mode 100755 (executable)
index 0000000..f9604bc
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+ME=molly-guard
+
+if [ ! -f /usr/bin/mythtv_recording_soon ]; then
+  echo "I: I can't find /usr/bin/mythtv_recording_soon, skipping check"
+  exit 0;
+fi
+
+HOSTNAME="$(hostname --short)"
+
+sigh()
+{
+  echo "Good thing I asked; I won't $CMD $HOSTNAME ..."
+  exit 1
+}
+
+
+if /usr/bin/mythtv_recording_soon; then
+  trap 'echo;sigh' 1 2 3 9 10 12 15
+  echo -n "MythTV is either recording now, or will be soon. Type YES to $CMD: "
+  read CONFIRM || :
+
+  [ $(echo "x$CONFIRM" | tr 'A-Z' 'a-z') = "xyes" ] || sigh
+
+  trap - 1 2 3 9 10 12 15
+fi
+
+exit 0
+