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:
parent
4308f247af
commit
502348577e
1 changed files with 1 additions and 2 deletions
|
@ -30,7 +30,6 @@
|
||||||
######################
|
######################
|
||||||
# Configuration
|
# Configuration
|
||||||
######################
|
######################
|
||||||
EXPR_BIN=/usr/bin/expr
|
|
||||||
LOGFILE=${logfile:-/var/log/mail.log}
|
LOGFILE=${logfile:-/var/log/mail.log}
|
||||||
######################
|
######################
|
||||||
|
|
||||||
|
@ -75,7 +74,7 @@ echo -n
|
||||||
######################
|
######################
|
||||||
DISCONNECTS=$(egrep -c '[dovecot]?.*Disconnected' $LOGFILE)
|
DISCONNECTS=$(egrep -c '[dovecot]?.*Disconnected' $LOGFILE)
|
||||||
CONNECTS=$(egrep -c '[dovecot]?.*Login' $LOGFILE)
|
CONNECTS=$(egrep -c '[dovecot]?.*Login' $LOGFILE)
|
||||||
VALUE=$($EXPR_BIN $CONNECTS - $DISCONNECTS)
|
VALUE=$(( CONNECTS - DISCONNECTS ))
|
||||||
if [ -z "$VALUE" ] || [ "$VALUE" -lt 0 ]; then
|
if [ -z "$VALUE" ] || [ "$VALUE" -lt 0 ]; then
|
||||||
VALUE=0
|
VALUE=0
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue