Provide, hopefully sane, defaults in health-check.
+ Support the Fedora config file for: health-check, mythtv_recording_now,
+ mythtv_recording_soon (not just mythtv-update-motd).
+
2023-07-27 Andrew Ruthven
Install the systemd files into the UsrMerge location so we'll work with
more distributions, thanks to Göran Uddeborgfor pointing this out.
#
# Run mythtv-status to perform a health check of the MythTV system.
-. /etc/default/mythtv-status
+# Debian style
+[ -r /etc/default/mythtv-status ] && . /etc/default/mythtv-status
+# Fedora style
+[ -r /etc/sysconfig/mythtv-status ] && . /etc/sysconfig/mythtv-status
if [ "$EMAIL" = "none" ]
then
NAME=mythtv-update-motd
# Debian style
-[ -r /etc/default/mythtv-status ] && . /etc/default/mythtv-status
+[ -r /etc/default/mythtv-status ] && . /etc/default/mythtv-status
# Fedora style
[ -r /etc/sysconfig/mythtv-status ] && . /etc/sysconfig/mythtv-status
# Return an exit code of 0 if the MythTV backend is currently recording
# a show.
-# Where Debian stores the config info.
-if [ -f /etc/default/mythtv-status ]
-then
- . /etc/default/mythtv-status
-fi
+# Debian style
+[ -r /etc/default/mythtv-status ] && . /etc/default/mythtv-status
+# Fedora style
+[ -r /etc/sysconfig/mythtv-status ] && . /etc/sysconfig/mythtv-status
+
/usr/bin/mythtv-status -h "${HOST:-localhost}" --return-code-only --recording-now
# Return an exit code of 0 if the MythTV backend is currently recording
# a show or will be recording a show soon (in the next hour).
-# Where Debian stores the config info.
-if [ -f /etc/default/mythtv-status ]
-then
- . /etc/default/mythtv-status
-fi
+# Debian style
+[ -r /etc/default/mythtv-status ] && . /etc/default/mythtv-status
+# Fedora style
+[ -r /etc/sysconfig/mythtv-status ] && . /etc/sysconfig/mythtv-status
if [ "x$1" != "x" ]
then