Include my Makefile in the tarball, this allows using "make install" to install
mythtv-status.
+ Make all shell scripts much clenaer according to shellcheck.
+
Refresh URLs in FAQ, update libmythtv-perl package name.
Remove obsolete question/answer from FAQ as my patch for improving storage
[ -r /etc/sysconfig/mythtv-status ] && . /etc/sysconfig/mythtv-status
# Support the old RUN variable
-[ x$UPDATE_MOTD = x ] && UPDATE_MOTD=$RUN
+[ "$UPDATE_MOTD" = "" ] && UPDATE_MOTD=$RUN
-if [ x$UPDATE_MOTD != xyes -o -f /var/lib/mythtv-status/motd_update_disabled ]
+if [ "$UPDATE_MOTD" != "yes" ] || [ -f /var/lib/mythtv-status/motd_update_disabled ]
then
exit
fi
DISTRO='unknown'
fi
- if [ $DISTRO = 'fedora' ]
+ if [ "$DISTRO" = 'fedora' ]
then
WORKFILE=/etc/motd
STUBFILE=/etc/motd.stub
fi
# Support the old ARGS variable
-[ x$UPDATE_MOTD_ARGS = x ] && UPDATE_MOTD_ARGS=$ARGS
+[ "$UPDATE_MOTD_ARGS" = "" ] && UPDATE_MOTD_ARGS=$ARGS
ret=0
mythtv-status $UPDATE_MOTD_ARGS -h $HOST >> $TEMPFILE || ret=$?
-if [ $ret -eq 0 -o $ret -eq 1 ]; then
+if [ $ret -eq 0 ] || [ $ret -eq 1 ]; then
if [ ! -f $TEMPFILE ]; then
echo My temporary file has gone away, failed.
exit 1
. /etc/default/mythtv-status
fi
-/usr/bin/mythtv-status -h ${HOST:=localhost} --return-code-only --recording-now
+/usr/bin/mythtv-status -h "${HOST:=localhost}" --return-code-only --recording-now
if [ $? -eq 1 ]
then
ARGS="--recording-in-warn 600"
fi
-/usr/bin/mythtv-status -h ${HOST:=localhost} --return-code-only \
+/usr/bin/mythtv-status -h "${HOST:=localhost}" --return-code-only \
--recording-now --next-recording $ARGS
if [ $? -eq 1 ]
#!/bin/sh
+# Copyright (c) 2008-2023 Andrew Ruthven <andrew@etc.gen.nz>
+# This code is hereby licensed for public consumption under the GNU GPL v3.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
ME=molly-guard
if [ ! -f /usr/bin/mythtv_recording_soon ]; then
- echo "I: I can't find /usr/bin/mythtv_recording_soon, skipping check" >&2
- exit 0;
+ echo "I: $ME: I can't find /usr/bin/mythtv_recording_soon, skipping check" >&2
+ exit 0
fi
HOSTNAME="$(hostname --short)"
if /usr/bin/mythtv_recording_soon; then
- trap 'echo;sigh' 1 2 3 9 10 12 15
- echo -n "MythTV is either recording now, or will be soon. Type YES to $MOLLYGUARD_CMD: "
+ trap 'echo;sigh' 1 2 3 10 12 15
+ printf "MythTV is either recording now, or will be soon. Type YES to %s: " "$MOLLYGUARD_CMD"
read CONFIRM || :
- [ $(echo "x$CONFIRM" | tr 'A-Z' 'a-z') = "xyes" ] || sigh
+ [ "$(echo "$CONFIRM" | tr 'A-Z' 'a-z')" = "yes" ] || sigh
- trap - 1 2 3 9 10 12 15
+ trap - 1 2 3 10 12 15
fi
exit 0