From 801d97c0559180cdeb6934bc66a119415bffaab9 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Sun, 6 Dec 2020 23:28:19 +1300 Subject: [PATCH] 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. --- ChangeLog | 4 ++++ update-motd.d/50-mythtv-status | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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 -- 2.30.2