--- /dev/null
+mythtv-status (0.1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Andrew Ruthven <andrew@etc.gen.nz> Sat, 13 Oct 2007 14:23:33 +1300
--- /dev/null
+#!/bin/sh
+
+PACKAGE=mythtv-status
+
+CONFIGFILE=/etc/default/$PACKAGE
+set -e
+. /usr/share/debconf/confmodule
+
+# Load config file, if it exists.
+if [ -e $CONFIGFILE ]; then
+ . $CONFIGFILE || true
+
+
+ # Store values from config file into
+ # debconf db.
+
+ db_set $PACKAGE/enable $RUN
+ db_set $PACKAGE/host $HOST
+
+fi
+
+# Ask questions.
+db_input medium $PACKAGE/host || true
+db_input medium $PACKAGE/enable || true
+db_go
--- /dev/null
+Source: mythtv-status
+Section: unknown
+Priority: extra
+Maintainer: Andrew Ruthven <andrew@etc.gen.nz>
+Build-Depends: debhelper (>= 5)
+Standards-Version: 3.7.2
+
+Package: mythtv-status
+Architecture: all
+Depends: ${misc:Depends}, ${perl:Depends}, libwww-perl, libxml-libxml-perl, libdate-manip-perl
+Description: Show the MythTV status
+ Shows the current MythTV status and the next 10 recordings
+ for today and tomorrow.
+ .
+ Also provides funtionality for updating the MOTD with
+ this information, this can provide a good heads on when
+ you should avoid heavy CPU or I/O work on your MythTV
+ backend.
--- /dev/null
+This package was debianized by Andrew Ruthven <andrew@etc.gen.nz> on
+Sat, 13 Oct 2007 14:23:33 +1300.
+
+Upstream Author(s):
+
+ Andrew Ruthven <andrew@etc.gen.nz>
+
+Copyright:
+
+ Copyright (C) 2007 Andrew Ruthven
+
+License:
+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License.
+
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this package; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2007, Andrew Ruthven <andrew@etc.gen.nz> and
+is licensed under the GPL, see above.
--- /dev/null
+#
+# Regular cron jobs for the mythtv-status package
+#
+*/10 * * * * root /etc/init.d/mythtv-status reload > /dev/null
--- /dev/null
+usr/bin
+usr/sbin
--- /dev/null
+#!/bin/sh
+#
+# Example init.d script with LSB support.
+#
+# Please read this init.d carefully and modify the sections to
+# adjust it to the program you want to run.
+#
+# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
+#
+# This is free software; you may redistribute it and/or modify
+# it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2,
+# or (at your option) any later version.
+#
+# This is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License with
+# the Debian operating system, in /usr/share/common-licenses/GPL; if
+# not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+#
+### BEGIN INIT INFO
+# Provides: mythtv-status
+# Required-Start: $mythtv-backend
+# Required-Stop:
+# Should-Start: $named
+# Should-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Update the MOTD with the MythTV status
+# Description: Update the MOTD with the MythTV status
+### END INIT INFO
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+DAEMON=/usr/sbin/mythtv-update-motd # Introduce the server's location here
+NAME=mythtv-status # Introduce the short server's name here
+DESC="MythTV Status" # Introduce a short description here
+LOGDIR=/var/log/mythtv-status # Log directory to use
+
+test -x $DAEMON || exit 0
+test -x $DAEMON_WRAPPER || exit 0
+
+. /lib/lsb/init-functions
+
+# Default options, these can be overriden by the information
+# at /etc/default/$NAME
+LOGFILE=$LOGDIR/$NAME.log # Server logfile
+
+# Include defaults if available
+if [ -f /etc/default/$NAME ] ; then
+ . /etc/default/$NAME
+fi
+
+# Use this if you want the user to explicitly set 'RUN' in
+# /etc/default/
+if [ "x$RUN" != "xyes" ] ; then
+ log_failure_msg "$NAME disabled, please adjust the configuration to your needs "
+ log_failure_msg "and then set RUN to 'yes' in /etc/default/$NAME to enable it."
+ exit
+fi
+
+set -e
+
+case "$1" in
+ start|reload|refresh)
+ log_daemon_msg "Updating $DESC " "$NAME"
+ [ ! -f /var/run/motd.orig ] && cp /var/run/motd /var/run/motd.orig
+
+ cp /var/run/motd.orig /var/run/motd.new
+
+ if mythtv-status -h $HOST >> /var/run/motd.new
+ then
+ mv /var/run/motd.new /var/run/motd
+ fi
+ #$DAEMON
+ log_end_msg 0
+ ;;
+ stop)
+ log_daemon_msg "Stoping $DESC " "$NAME"
+ [ -f /var/run/motd.orig ] && cp /var/run/motd.orig /var/run/motd
+ log_end_msg 0
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ echo "Usage: $N {start|stop|reload|refresh}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
--- /dev/null
+bin/mythtv-status usr/bin
+bin/mythtv-update-motd usr/sbin
--- /dev/null
+#!/bin/sh
+# postinst script for mythtv-status
+#
+# see: dh_installdeb(1)
+
+PACKAGE=mythtv-status
+
+. /usr/share/debconf/confmodule
+
+set -e
+
+case "$1" in
+ configure|reconfigure)
+ DEBIANCONFIG=/etc/default/$PACKAGE
+
+ # load current settings, most of which will be overwritten.
+ [ -f $DEBIANCONFIG ] && . $DEBIANCONFIG
+
+ db_get $PACKAGE/host
+ HOST="${RET:-localhost}"
+
+ db_get $PACKAGE/enable
+ RUN="${RET:-true}"
+
+ if [ $RUN == 'true' ]
+ then
+ RUN='yes'
+ fi
+
+ cat <<_eof > $DEBIANCONFIG
+# $PACKAGE Debian configuration
+#
+# You can run 'dpkg-reconfigure $PACKAGE' to modify the values in this
+# file, if you want. You can also change the values here and changes will
+# be preserved.
+#
+# Do note that only the values are preserved; the rest of the file is
+# rewritten.
+#
+
+# RUN:
+# Should we actually run and update the MOTD?
+RUN=$RUN
+
+# HOST:
+# What host should be check the status on?
+HOST=$HOST
+_eof
+
+ db_stop
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- /dev/null
+#!/bin/sh
+# postrm script for mythtv-status
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ purge|remove|failed-upgrade|abort-install|abort-upgrade|disappear)
+ if [ -f /var/run/motd.orig ]
+ then
+ mv /var/run/motd.orig /var/run/motd
+ fi
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
--- /dev/null
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+ dh_clean
+
+install:
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+# Build architecture-independent files here.
+binary-indep: install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+ dh_install
+ dh_installdebconf
+# Make sure we start after mythtv-backend
+ dh_installinit -- defaults 21
+ dh_installcron
+ dh_installman
+ dh_compress
+ dh_fixperms
+ dh_perl
+ dh_installdeb
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- /dev/null
+Template: mythtv-status/host
+Type: string
+Default: localhost
+Description: MythTV backend to check
+ The MythTV backend to check, you only need to change this if you want to check
+ a different host.
+
+Template: mythtv-status/enable
+Type: boolean
+Default: true
+Description: Update the system MOTD?
+ Should the Message of the Day be updated on system boot and on a regular
+ basis?
+ .
+ To adjust how often the MOTD is updated, edit /etc/cron.d/mythtv-status.