fix mailtest-check commits from today
authorIan Kelling <ian@iankelling.org>
Thu, 2 Mar 2023 01:56:02 +0000 (20:56 -0500)
committerIan Kelling <ian@iankelling.org>
Thu, 2 Mar 2023 01:56:02 +0000 (20:56 -0500)
mailtest-check

index 06ddec68063f9415a05db1a7f5ae51cb8d0227a9..d5d30aa6ae2f275654ed391053bbaa1bafb87657 100755 (executable)
@@ -76,7 +76,7 @@ esac
 
 main() {
 
-  local -a unexpected_spamd_results missing_dnswl last_usec
+  local -a p_unexpected_spamd_results p_missing_dnswl p_last_usec
   case $HOSTNAME in
     bk)
       folders=(/m/md/{expertpathologyreview.com,amnimal.ninja}/testignore)
@@ -287,10 +287,10 @@ EOF
                 ;;
             esac
           done
-          mapfile -O ${#missing_dnswl[@]} -t missing_dnswl <<EOF
+          mapfile -O ${#p_missing_dnswl[@]} -t p_missing_dnswl <<EOF
 mailtest_check_missing_dnswl{folder="$folder",from="$from"} $missing_dnswl
 EOF
-          mapfile -O ${#unexpected_spamd_results[@]} -t unexpected_spamd_results <<EOF
+          mapfile -O ${#p_unexpected_spamd_results[@]} -t p_unexpected_spamd_results <<EOF
 mailtest_check_unexpected_spamd_results{folder="$folder",from="$from"} $unexpected
 EOF
         fi # if spamdpid
@@ -301,7 +301,7 @@ EOF
       e $((age_sec / 60)):$(( age_sec % 60 )) ago. to:$to from:$from $latest
 
       # usec = unix seconds
-      mapfile -O ${#last_usec[@]} -t last_usec <<EOF
+      mapfile -O ${#p_last_usec[@]} -t p_last_usec <<EOF
 mailtest_check_last_usec{folder="$folder",from="$from"} $last_sec
 EOF
     done # end for from in ${froms[@]}
@@ -310,13 +310,13 @@ EOF
   dir=/var/lib/prometheus/node-exporter
   path=$dir/mailtest-check.prom.$$
   if $doprom && [[ -e $dir  ]]; then
-    for l in "${unexpected_spamd_results[@]}"; do
+    for l in "${p_unexpected_spamd_results[@]}"; do
       printf "%s\n" "$l" >>$path
       done
-    for l in "${missing_dnswl[@]}"; do
+    for l in "${p_missing_dnswl[@]}"; do
       printf "%s\n" "$l" >>$path
     done
-    for l in "${last_usec[@]}"; do
+    for l in "${p_last_usec[@]}"; do
       printf "%s\n" "$l" >>$path
     done
     mv $path $dir/mailtest-check.prom