Skip to content

Commit

Permalink
Plugin dovecot: remove usage of "expr"
Browse files Browse the repository at this point in the history
The usage of "expr" can be replaced easily with a shell builtin.
"expr" caused problems due to its hard-coded path.

Closes: #1240
  • Loading branch information
sumpfralle committed Oct 13, 2021
1 parent 4308f24 commit 5023485
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions plugins/dovecot/dovecot
Expand Up @@ -30,7 +30,6 @@
######################
# Configuration
######################
EXPR_BIN=/usr/bin/expr
LOGFILE=${logfile:-/var/log/mail.log}
######################

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5023485

Please sign in to comment.