From: Andrew Ruthven Date: Tue, 28 Oct 2008 02:50:15 +0000 (+1300) Subject: Provide at least some error checking on the results from mythtv-status before updatie... X-Git-Tag: debian-0.9.0-4~2 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f30b6bb3a574df6a7588ac81a534a1647657352;p=mythtv-status.git Provide at least some error checking on the results from mythtv-status before updatieng the MOTD. We don't really want to blindly append to the running MOTD file even if we know that mythtv-status failed. --- diff --git a/debian/changelog b/debian/changelog index df7390a..9c17acb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ mythtv-status (0.9.0-3) unstable; urgency=medium * 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 Tue, 28 Oct 2008 15:12:02 +1300 diff --git a/debian/init.d b/debian/init.d index 14c7703..9c2f979 100644 --- a/debian/init.d +++ b/debian/init.d @@ -65,7 +65,9 @@ case "$1" in 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)