From: Andrew Ruthven Date: Sat, 5 Jul 2008 10:12:46 +0000 (+1200) Subject: Make /etc/default/mythtv-status a bit clearer and fix a bug with EMAIL_ARGS in the... X-Git-Tag: 0.9.0~3 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ee8f47ffa1c7fd0b751ff25dfcd764a14da9cf5;p=mythtv-status.git Make /etc/default/mythtv-status a bit clearer and fix a bug with EMAIL_ARGS in the postinst. The comments in /etc/default/mythtv-status should now be a bit clearer about which scripts use which variables. In the postinst I was setting EMAIL_ARGS to a default setting it wasn't set. This caused it not "remember" if someone had removed the arguments and always reset it to the default setting. Now the default setting is set before the config file is loaded. So that any settings (or unsettings) in the config file will be used. --- diff --git a/debian/changelog b/debian/changelog index e7427c2..016cb61 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +mythtv-status (0.8.1-3) unstable; urgency=low + + * A number of small changes to the /etc/default/mythtv-status file + to make it clearer which script uses which settings. + * Thank you to Tom Metro for the above suggestion. + * Fix the handling of EMAIL_ARGS in the postinst to honour it being + unset. Thank you to Tom for reporting the issue. + + -- Andrew Ruthven Sat, 5 Jul 2008 21:15:00 +1200 + mythtv-status (0.8.1-2) unstable; urgency=low * Make sure that variables in /etc/default/mythtv-status that might diff --git a/debian/cron.daily b/debian/cron.daily index 54295bc..5bab4e9 100644 --- a/debian/cron.daily +++ b/debian/cron.daily @@ -9,5 +9,5 @@ fi /usr/bin/mythtv-status --host $HOST --email $EMAIL $EMAIL_ARGS -# Keep run-parts happy by always return a return code of 0. +# Keep run-parts happy by always returning with a return code of 0. exit 0 diff --git a/debian/postinst b/debian/postinst index 2c968dd..54aee1e 100644 --- a/debian/postinst +++ b/debian/postinst @@ -13,6 +13,9 @@ case "$1" in configure|reconfigure) DEBIANCONFIG=/etc/default/$PACKAGE + # Default to --email-only-on-alert but allow it be unset in the config file. + EMAIL_ARGS="---email-only-on-alert" + # load current settings, most of which will be overwritten. [ -f $DEBIANCONFIG ] && . $DEBIANCONFIG @@ -30,32 +33,39 @@ case "$1" in db_get $PACKAGE/email EMAIL="${RET:-none}" - EMAIL_ARGS="${EMAIL_ARGS:---email-only-on-alert}" - 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. +# be preserved. But other changes will not be preserved. # # Do note that only the values are preserved; the rest of the file is # rewritten. # +# HOST: +# What host should we check the status on? +HOST=$HOST + +######################################################################## +# The following settings are used by /etc/init.d/mythtv-status script # +# to update the MOTD. # +######################################################################## + # RUN: # Should we actually run and update the MOTD? RUN=$RUN -# HOST: -# What host should be check the status on? -HOST=$HOST - # ARGS: # Any extra arguments to pass to mythtv-status (i.e., -e and/or -d). -# This is used by /etc/init.d/mythtv-status script. ARGS="$ARGS" +######################################################################## +# The following settings are used by the /etc/cron.daily/mythtv-status # +# script when generating the daily status email report. # +######################################################################## + # EMAIL: # A comma separated list of email address to send status emails to. # @@ -64,7 +74,6 @@ EMAIL=$EMAIL # EMAIL_ARGS: # Command line arguments that are used when sending the daily email. -# This is used by /etc/cron.daily/mythtv-status script. EMAIL_ARGS="$EMAIL_ARGS" _eof