We don't really want to blindly append to the running MOTD file
even if we know that mythtv-status failed.
* If someone has removed /var/run/motd then tries to install (or
reinstall) this package, then it fails. We should make sure that
doesn't happen by making sure that /var/run/motd exists.
+ * Provide some sanity checking before updating the MOTD file in
+ the init.d script to make sure that mythtv-status didn't die.
-- Andrew Ruthven <andrew@etc.gen.nz> Tue, 28 Oct 2008 15:12:02 +1300
cp /var/run/motd.orig /var/run/motd.new
$DAEMON $ARGS -h $HOST >> /var/run/motd.new
- mv /var/run/motd.new /var/run/motd
+ if [ $? -eq 0 -o $? -eq 1 ]; then
+ mv /var/run/motd.new /var/run/motd
+ fi
log_end_msg 0
;;
stop)