if [ -d /etc/update-motd.d ]
then
+ # We want to generate file which only contains the MythTV Status
+ # as a snippet in /etc/update-motd.d will cat this file.
+
WORKFILE=/var/run/motd.mythtv-status
TEMPFILE=${WORKFILE}.new
else
+ # We are going to generate an motd file to be used for the system,
+ # with the previous content first, then the MythTV Status.
+
# Debian Wheezy+ handles the MOTD differently.
[ -f /var/run/motd.dynamic ] && WORKFILE=/var/run/motd.dynamic
# Just incase someone has removed their motd file.
[ -f $WORKFILE ] || touch $WORKFILE
+ # Keep the original content around.
[ -f /var/run/motd.orig ] || cp $WORKFILE /var/run/motd.orig
# If the tempfile is less than 15 minutes old, object, otherwise
fi
fi
- [ ! -f /var/run/motd.orig ] && cp /var/run/motd /var/run/motd.orig
-
- cp /var/run/motd.orig /var/run/motd.new
+ # Have whatever the system motd contains before the MythTV content
+ cp /var/run/motd.orig $TEMPFILE
fi