From: Andrew Ruthven Date: Wed, 21 Nov 2007 05:28:42 +0000 (+1300) Subject: Add a cron.daily file and debconf support bits for sending a daily email. X-Git-Tag: 0.5~8 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db2f7df40ac070962e95cd1111010b6537f5d106;p=mythtv-status.git Add a cron.daily file and debconf support bits for sending a daily email. By default it only emails if there are schedule conflicts. --- diff --git a/debian/config b/debian/config index 32bf787..8c5ff3d 100644 --- a/debian/config +++ b/debian/config @@ -16,10 +16,12 @@ if [ -e $CONFIGFILE ]; then db_set $PACKAGE/enable $RUN db_set $PACKAGE/host $HOST + db_set $PACKAGE/email $EMAIL fi # Ask questions. db_input medium $PACKAGE/host || true db_input medium $PACKAGE/enable || true +db_input medium $PACKAGE/email || true db_go diff --git a/debian/cron.daily b/debian/cron.daily new file mode 100644 index 0000000..754cc8f --- /dev/null +++ b/debian/cron.daily @@ -0,0 +1,10 @@ +#!/bin/sh + +. /etc/default/mythtv-status + +if [ "x$EMAIL" = "x" -o "x$EMAIL" = "xnone" ] +then + exit +fi + +/usr/bin/mythtv-status --email $EMAIL $EMAIL_ARGS diff --git a/debian/po/fr.po b/debian/po/fr.po index 134ab16..3cf7d93 100644 --- a/debian/po/fr.po +++ b/debian/po/fr.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"Report-Msgid-Bugs-To: Source: mythtv-status@packages.debian.org\n" -"POT-Creation-Date: 2007-11-16 12:53+1300\n" +"Report-Msgid-Bugs-To: andrew@etc.gen.nz\n" +"POT-Creation-Date: 2007-11-21 14:45+1300\n" "PO-Revision-Date: 2007-11-16 12:53+1300\n" "Last-Translator: Francois Marier \n" "Language-Team: French \n" @@ -29,8 +29,8 @@ msgid "" "The MythTV backend to check, you only need to change this if you want to " "check a different host." msgstr "" -"Le système MythTV à examiner. Vous n'avez à changer la valeur par défaut " -"que si vous désirer examiner un autre hôte." +"Le système MythTV à examiner. Vous n'avez à changer la valeur par défaut que " +"si vous désirer examiner un autre hôte." #. Type: boolean #. Description @@ -45,8 +45,8 @@ msgid "" "Whether the Message of the Day should be updated on system boot and on a " "regular basis." msgstr "" -"Mise à jour du message du jour du système lors du démarrage et sur une " -"base régulière." +"Mise à jour du message du jour du système lors du démarrage et sur une base " +"régulière." #. Type: boolean #. Description @@ -56,3 +56,27 @@ msgid "" msgstr "" "Pour changer la fréquence de mise à jour du message du jour, modifier le " "fichier /etc/cron.d/mythtv-status." + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Email status to?" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Who should we send emails to on a daily basis?" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "By default an email is only sent if there is a conflict." +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "To disable set the email address to \"none\"." +msgstr "" diff --git a/debian/po/pt.po b/debian/po/pt.po index a36e48f..f3d4f28 100644 --- a/debian/po/pt.po +++ b/debian/po/pt.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: mythtv-status 0.4-1\n" -"Report-Msgid-Bugs-To: Source: mythtv-status@packages.debian.org\n" -"POT-Creation-Date: 2007-11-16 12:53+1300\n" +"Report-Msgid-Bugs-To: andrew@etc.gen.nz\n" +"POT-Creation-Date: 2007-11-21 14:45+1300\n" "PO-Revision-Date: 2007-11-18 18:40+0000\n" "Last-Translator: Américo Monteiro \n" "Language-Team: Portuguese \n" @@ -51,8 +51,32 @@ msgstr "" #. Type: boolean #. Description #: ../templates:2001 -msgid "To adjust how often the MOTD is updated, edit /etc/cron.d/mythtv-status." +msgid "" +"To adjust how often the MOTD is updated, edit /etc/cron.d/mythtv-status." +msgstr "" +"Para ajustar a frequência de actualização do MOTD, edite /etc/cron.d/mythtv-" +"status." + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Email status to?" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Who should we send emails to on a daily basis?" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "By default an email is only sent if there is a conflict." msgstr "" -"Para ajustar a frequência de actualização do MOTD, " -"edite /etc/cron.d/mythtv-status." +#. Type: string +#. Description +#: ../templates:3001 +msgid "To disable set the email address to \"none\"." +msgstr "" diff --git a/debian/po/templates.pot b/debian/po/templates.pot index 0fd89b5..9f69a2d 100644 --- a/debian/po/templates.pot +++ b/debian/po/templates.pot @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: Source: mythtv-status@packages.debian.org\n" -"POT-Creation-Date: 2007-11-16 12:53+1300\n" +"Report-Msgid-Bugs-To: andrew@etc.gen.nz\n" +"POT-Creation-Date: 2007-11-21 14:45+1300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -50,3 +50,27 @@ msgstr "" msgid "" "To adjust how often the MOTD is updated, edit /etc/cron.d/mythtv-status." msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Email status to?" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "Who should we send emails to on a daily basis?" +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "By default an email is only sent if there is a conflict." +msgstr "" + +#. Type: string +#. Description +#: ../templates:3001 +msgid "To disable set the email address to \"none\"." +msgstr "" diff --git a/debian/postinst b/debian/postinst index fc12623..86e2e33 100644 --- a/debian/postinst +++ b/debian/postinst @@ -27,6 +27,11 @@ case "$1" in RUN='yes' fi + db_get $PACKAGE/email + EMAIL="${RET:-none}" + + EMAIL_ARGS="${EMAIL_ARGS:--email-only-on-conflict}" + cat <<_eof > $DEBIANCONFIG # $PACKAGE Debian configuration # @@ -49,6 +54,16 @@ HOST=$HOST # ARGS: # Any extra arguments to pass to mythtv-status (i.e., -e and/or -d). ARGS=$ARGS + +# EMAIL: +# A comma separated list of email address to send status emails to. +# +# Set to none (or leave empty) to disable daily emails. +EMAIL=$EMAIL + +# EMAIL_ARGS: +# Command line arguments that are used when sending the daily email. +EMAIL_ARGS=$EMAIL_ARGS _eof db_stop diff --git a/debian/templates b/debian/templates index 3c247d6..a734cc4 100644 --- a/debian/templates +++ b/debian/templates @@ -13,3 +13,13 @@ _Description: Update the system MOTD? regular basis. . To adjust how often the MOTD is updated, edit /etc/cron.d/mythtv-status. + +Template: mythtv-status/email +Type: string +Default: none +_Description: Email status to? + Who should we send emails to on a daily basis? + . + By default an email is only sent if there is a conflict. + . + To disable set the email address to "none".