iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixes
[distro-setup]
/
mailtest-check
diff --git
a/mailtest-check
b/mailtest-check
index 5cf79fe8278b8ae69532ee66fb17b60e49ac793a..89ed00c1cd54e10f51e31d4c784ab2f7e2e78f6f 100755
(executable)
--- a/
mailtest-check
+++ b/
mailtest-check
@@
-131,13
+131,14
@@
EOF
fi
# webmail sends them to cur it seems
while read -r file; do
fi
# webmail sends them to cur it seems
while read -r file; do
- if [[ $file -nt $latest ]]; then
+ file_sec=$(awk '/^Subject: / {print $4}' $file)
+ if [[ $file_sec ]] && (( file_sec > last_sec )); then
latest=$file
latest=$file
+ last_sec="$file_sec"
fi
done <$tmpfile
to=$(awk '/^Envelope-to: / {print $2}' $latest)
fi
done <$tmpfile
to=$(awk '/^Envelope-to: / {print $2}' $latest)
- last_sec=$(awk '/^Subject: / {print $4}' $latest)
if $slow; then
if ! $int; then
if $slow; then
if ! $int; then
@@
-236,6
+237,7
@@
EOF
#fi
fi
rm -f $resultfile
#fi
fi
rm -f $resultfile
+ unexpected=$(( unexpected + ${#results[@]} + ${#missing[@]} ))
fi # if spamdpid
fi # if $slow
fi # if spamdpid
fi # if $slow
@@
-247,9
+249,8
@@
EOF
pr <<EOF
mailtest_check_last_usec{folder="$folder",from="$from"} $last_sec
EOF
pr <<EOF
mailtest_check_last_usec{folder="$folder",from="$from"} $last_sec
EOF
- done
- unexpected=$(( unexpected + ${#results[@]} + ${#missing[@]} ))
- done
+ done # end for from in ${froms[@]}
+ done # end for folder in ${folders[@]}
if $slow; then
pr <<EOF
mailtest_check_unexpected_spamd_results $unexpected
if $slow; then
pr <<EOF
mailtest_check_unexpected_spamd_results $unexpected
@@
-264,10
+265,13
@@
EOF
}
loop-main() {
}
loop-main() {
+ # When running under systemd, the system just started. Ve nice and
+ # give programs some time to finish their startup.
+ sleep 5
while true; do
premain_sec=$EPOCHSECONDS
main
while true; do
premain_sec=$EPOCHSECONDS
main
- sleep $(( 300 - (
$
EPOCHSECONDS - premain_sec ) ))
+ sleep $(( 300 - ( EPOCHSECONDS - premain_sec ) ))
done
}
done
}