. /etc/default/mythtv-status
-if [ x$RUN != xyes -o -f /var/lib/mythtv-status/motd_update_disabled ]
+if [ x$UPDATE_MOTD != xyes -o -f /var/lib/mythtv-status/motd_update_disabled ]
then
exit
fi
ret=0
-mythtv-status $ARGS -h $HOST >> $TEMPFILE || ret=$?
+mythtv-status $UPDATE_MOTD_ARGS -h $HOST >> $TEMPFILE || ret=$?
if [ $ret -eq 0 -o $ret -eq 1 ]; then
if [ ! -f $TEMPFILE ]; then
echo My temporary file has gone away, failed.
if [ "x$1" != "x" ]
then
- ARGS="--recording-in-warn $1"
+ UPDATE_MOTD_ARGS="--recording-in-warn $1"
else
- ARGS="--recording-in-warn 600"
+ UPDATE_MOTD_ARGS="--recording-in-warn 600"
fi
/usr/bin/mythtv-status -h ${HOST:=localhost} --return-code-only \
- --recording-now --next-recording $ARGS
+ --recording-now --next-recording $UPDATE_MOTD_ARGS
if [ $? -eq 1 ]
then
* Install a snippet into /etc/update-motd.d (Closes: #902684).
* Update standards version to 4.3.0.
* Ship a systemd service file (Closes: #772801)
+ * Rename RUN and ARGS in /etc/default/mythtv-status to be more
+ specific, since this file is used by a couple of different scripts.
-- Andrew Ruthven <andrew@etc.gen.nz> Mon, 31 Dec 2018 21:58:47 +1300
# Store values from config file into
# debconf db.
- db_set $PACKAGE/enable $RUN
+ if [ "x$RUN" != "x" ]
+ then
+ db_set $PACKAGE/enable $RUN
+ fi
+ if [ "x$UPDATE_MOTD" != "x" ]
+ then
+ db_set $PACKAGE/enable $UPDATE_MOTD
+ fi
db_set $PACKAGE/host $HOST
db_set $PACKAGE/email $EMAIL
. /etc/default/$NAME
fi
-# Use this if you want the user to explicitly set 'RUN' in
-# /etc/default/
-if [ "x$RUN" != "xyes" ] ; then
+# Use this if you want the user to explicitly set 'UPDATE_MOTD' in
+# /etc/default/mythtv-status
+if [ "x$UPDATE_MOTD" != "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."
+ log_failure_msg "and then set UPDATE_MOTD to 'yes' in /etc/default/$NAME to enable it."
exit
fi
HOST="${RET:-localhost}"
db_get $PACKAGE/enable
- RUN="${RET:-true}"
+ UPDATE_MOTD="${RET:-true}"
- if [ $RUN = 'true' ]
+ if [ $UPDATE_MOTD = 'true' ]
then
- RUN='yes'
+ UPDATE_MOTD='yes'
+ fi
+
+ # Support the old variable name.
+ if [ "x$RUN" != "x" ]
+ then
+ UPDATE_MOTD=$RUN
+ fi
+
+ # Support the old variable name.
+ if [ "x$ARGS != "x" ]
+ then
+ UPDATE_MOTD_ARGS=$ARGS
fi
db_get $PACKAGE/email
HOST=$HOST
########################################################################
-# The following settings are used by /etc/init.d/mythtv-status script #
-# to update the MOTD. #
+# The following settings are used by the /etc/init.d/mythtv-status and #
+# mythtv-update-motd scripts to update the MOTD. #
########################################################################
-# RUN:
+# UPDATE_MOTD:
# Should we actually run and update the MOTD?
-RUN=$RUN
+UPDATE_MOTD=$UPDATE_MOTD
-# ARGS:
-# Any extra arguments to pass to mythtv-status (i.e., -e and/or -d).
-ARGS="$ARGS"
+# UPDATE_MOTD_ARGS:
+# Any extra arguments to pass to mythtv-status (i.e., -e -d).
+UPDATE_MOTD_ARGS="$UPDATE_MOTD_ARGS"
########################################################################
# The following settings are used by the /etc/cron.daily/mythtv-status #
.B HOST
The host to check, by default this is localhost.
.TP
-.B RUN
+.B UPDATE_MOTD
Should this script run? Set to yes to enable, anything else to disable.
+.TP
+.B UPDATE_MOTD_ARGS
+Any additional arguments you'd like to have run if the MOTD is updated by this
+script.
.PP
.PD 0
You can also disable this script from running by creating a file