From: Ian Kelling Date: Wed, 1 Mar 2023 22:07:40 +0000 (-0500) Subject: fix ordering for unified text file X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=cd8ada3f2923a3937e212d79748623b003cad62e;p=distro-setup fix ordering for unified text file --- 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 }