From cd8ada3f2923a3937e212d79748623b003cad62e Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 1 Mar 2023 17:07:40 -0500 Subject: [PATCH] fix ordering for unified text file --- mailtest-check | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/mailtest-check b/mailtest-check index 036aeff..599d4b6 100755 --- a/mailtest-check +++ b/mailtest-check @@ -28,11 +28,6 @@ getspamdpid() { done fi } -pr() { - if $doprom && [[ -e /var/lib/prometheus/node-exporter ]]; then - cat >>/var/lib/prometheus/node-exporter/mailtest-check.prom.$$ - fi -} #### begin arg processing #### @@ -81,6 +76,7 @@ esac main() { + local -a unexpected_spamd_results missing_dnswl last_usec case $HOSTNAME in bk) folders=(/m/md/{expertpathologyreview.com,amnimal.ninja}/testignore) @@ -291,8 +287,10 @@ EOF ;; esac done - pr <>$path + done + for l in "${missing_dnswl[@]}"; do + printf "%s\n" "$l" >>$path + done + for l in "${last_usec[@]}"; do + printf "%s\n" "$l" >>$path + done + mv $path $dir/mailtest-check.prom # note: node_textfile_mtime_seconds will tell us when this last happened. useful for debugging. fi } -- 2.30.2