From: Andrew Ruthven Date: Sun, 6 Dec 2020 10:28:19 +0000 (+1300) Subject: Ensure that 50-mythtv-status has exit code 0 if no status file eixsts. X-Git-Tag: 1.0.2~14 X-Git-Url: http://git.etc.gen.nz/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=801d97c0559180cdeb6934bc66a119415bffaab9;p=mythtv-status.git Ensure that 50-mythtv-status has exit code 0 if no status file eixsts. I noticed that if /run/motd.mythtv-status doesn't exist then update-motd.d/50-mythtv-status exits with exit code 1 and pam_motd spits a warning. I don't really want that to happen. --- diff --git a/ChangeLog b/ChangeLog index 47894d9..79c3d79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ 2020-12-06 Andrew Ruthven Minor update to systemd service file. + I noticed that if /run/motd.mythtv-status doesn't exist then + update-motd.d/50-mythtv-status exits with exit code 1 and pam_motd spits a + warning. I don't really want that to happen. + 2019-01-29 Andrew Ruthven Release version 1.0.1. diff --git a/update-motd.d/50-mythtv-status b/update-motd.d/50-mythtv-status index e24c0b6..5bc5b38 100755 --- a/update-motd.d/50-mythtv-status +++ b/update-motd.d/50-mythtv-status @@ -2,4 +2,9 @@ # See: # man mythtv-update-motd # on how to disable this service if you don't want it to run. -[ -f /run/motd.mythtv-status ] && cat /run/motd.mythtv-status + +if [ -f /run/motd.mythtv-status ]; then + cat /run/motd.mythtv-status +else + exit 0 +fi