From a5e5f29fb92bdfefe194cd3fb81a3bb9ba94c1be Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 9 Apr 2018 12:59:08 +0200 Subject: digest-mailer.in: fix bc --- digest-mailer.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-70-g09d2