summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-04-09 12:59:08 +0200
committerErich Eckner <git@eckner.net>2018-04-09 12:59:08 +0200
commita5e5f29fb92bdfefe194cd3fb81a3bb9ba94c1be (patch)
treebcb9bb909fcb6e6d3e6e3af6270fe53de76cfbb5
parent06eb8457ed8738a509a04185a3e07c42cbab6b4b (diff)
downloaddigest-mailer-a5e5f29fb92bdfefe194cd3fb81a3bb9ba94c1be.tar.xz
digest-mailer.in: fix bc
-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