summaryrefslogtreecommitdiff
path: root/digest-mailer.in
diff options
context:
space:
mode:
Diffstat (limited to 'digest-mailer.in')
-rw-r--r--digest-mailer.in7
1 files changed, 6 insertions, 1 deletions
diff --git a/digest-mailer.in b/digest-mailer.in
index 0ac607e..ec333c8 100644
--- a/digest-mailer.in
+++ b/digest-mailer.in
@@ -94,7 +94,12 @@ if [ $((last_sent + min_delay)) -gt ${time} ]; then
exit
fi
if [ ${to_send_count} -gt 1 ] && \
- [ $(printf 'scale=10; (%s+%s)*%s + (%s+%s)*(1-%s)\n' "${min_delay}" "${last_sent}" "${agressivity}" "${max_delay}" "${first_unsent}" "${agressivity}" | bc) -gt ${time} ] && \
+ printf '%s - (%s+%s)*%s - (%s+%s)*(1-%s)\n' \
+ "${time}" \
+ "${min_delay}" "${last_sent}" "${agressivity}" \
+ "${max_delay}" "${first_unsent}" "${agressivity}" | \
+ bc | \
+ grep -q '^-' && \
[ $((first_unsent + max_delay)) -ge ${time} ]; then
exit
fi