Révision 50234857
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
| plugins/dovecot/dovecot | ||
|---|---|---|
| 30 | 30 |
###################### |
| 31 | 31 |
# Configuration |
| 32 | 32 |
###################### |
| 33 |
EXPR_BIN=/usr/bin/expr |
|
| 34 | 33 |
LOGFILE=${logfile:-/var/log/mail.log}
|
| 35 | 34 |
###################### |
| 36 | 35 |
|
| ... | ... | |
| 75 | 74 |
###################### |
| 76 | 75 |
DISCONNECTS=$(egrep -c '[dovecot]?.*Disconnected' $LOGFILE) |
| 77 | 76 |
CONNECTS=$(egrep -c '[dovecot]?.*Login' $LOGFILE) |
| 78 |
VALUE=$($EXPR_BIN $CONNECTS - $DISCONNECTS)
|
|
| 77 |
VALUE=$(( CONNECTS - DISCONNECTS ))
|
|
| 79 | 78 |
if [ -z "$VALUE" ] || [ "$VALUE" -lt 0 ]; then |
| 80 | 79 |
VALUE=0 |
| 81 | 80 |
fi |
Formats disponibles : Unified diff