1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Plugin dovecot: remove usage of "expr"

The usage of "expr" can be replaced easily with a shell builtin.
"expr" caused problems due to its hard-coded path.

Closes: #1240
This commit is contained in:
Lars Kruse 2021-10-13 12:29:35 +02:00
parent 4308f247af
commit 502348577e

View file

@ -30,7 +30,6 @@
######################
# Configuration
######################
EXPR_BIN=/usr/bin/expr
LOGFILE=${logfile:-/var/log/mail.log}
######################
@ -75,7 +74,7 @@ echo -n
######################
DISCONNECTS=$(egrep -c '[dovecot]?.*Disconnected' $LOGFILE)
CONNECTS=$(egrep -c '[dovecot]?.*Login' $LOGFILE)
VALUE=$($EXPR_BIN $CONNECTS - $DISCONNECTS)
VALUE=$(( CONNECTS - DISCONNECTS ))
if [ -z "$VALUE" ] || [ "$VALUE" -lt 0 ]; then
VALUE=0
fi