iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix root mail on bk, nonroot stuff, misc prom updates
[distro-setup]
/
mailtest-check
diff --git
a/mailtest-check
b/mailtest-check
index 1975dc960b71f2023b2162f3e929de7aed0b56e3..2dcc7b215a7bc4cb748c98191f0953d809756f5b 100755
(executable)
--- a/
mailtest-check
+++ b/
mailtest-check
@@
-81,7
+81,9
@@
getspamdpid() {
}
getspamdpid
pr() {
}
getspamdpid
pr() {
- cat >>/var/lib/prometheus/node-exporter/mailtest-check.prom.$$
+ if [[ -e /var/lib/prometheus/node-exporter ]]; then
+ cat >>/var/lib/prometheus/node-exporter/mailtest-check.prom.$$
+ fi
}
pr <<EOF
mailtest_check_found_spamd_pid_bool $(( ${spamdpid:-0} > 0 ))
}
pr <<EOF
mailtest_check_found_spamd_pid_bool $(( ${spamdpid:-0} > 0 ))
@@
-217,4
+219,8
@@
if $slow; then
mailtest_check_unexpected_spamd_results $unexpected
EOF
fi
mailtest_check_unexpected_spamd_results $unexpected
EOF
fi
-mv /var/lib/prometheus/node-exporter/mailtest-check.prom.$$ /var/lib/prometheus/node-exporter/mailtest-check.prom
+
+dir=/var/lib/prometheus/node-exporter
+if [[ -e $dir ]]; then
+ mv $dir/mailtest-check.prom.$$ $dir/mailtest-check.prom
+fi