summaryrefslogtreecommitdiffstats
path: root/plugins-scripts/utils.sh.in
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2014-01-13 22:55:43 +0100
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-01-13 22:55:43 +0100
commit9db763963f3993f923619a2147e4313b09f12134 (patch)
tree7de03645f44f5b5ec42bb8894b0c5b3165196e25 /plugins-scripts/utils.sh.in
parent20b598da6ee238a608c17524c4483fea1b14a4fa (diff)
downloadmonitoring-plugins-9db763963f3993f923619a2147e4313b09f12134.tar.gz
utils.sh: Don't define $ECHO
In utils.sh, $ECHO was set to printf(1) or echo(1), depending on whether printf(1) is available in /usr/bin. This resulted in various bugs, as printf(1) cannot be used in the same way as echo(1). Thanks to Trevor Hemsley for reporting one of those bugs: If $ECHO was set to printf(1), check_log stumbled when reporting a log line with a "%" character.
Diffstat (limited to 'plugins-scripts/utils.sh.in')
-rw-r--r--plugins-scripts/utils.sh.in10
1 files changed, 2 insertions, 8 deletions
diff --git a/plugins-scripts/utils.sh.in b/plugins-scripts/utils.sh.in
index 4a07df89..031c0357 100644
--- a/plugins-scripts/utils.sh.in
+++ b/plugins-scripts/utils.sh.in
@@ -6,19 +6,13 @@ STATE_CRITICAL=2
6STATE_UNKNOWN=3 6STATE_UNKNOWN=3
7STATE_DEPENDENT=4 7STATE_DEPENDENT=4
8 8
9if test -x /usr/bin/printf; then
10 ECHO=/usr/bin/printf
11else
12 ECHO=echo
13fi
14
15print_revision() { 9print_revision() {
16 echo "$1 v$2 (@PACKAGE@ @VERSION@)" 10 echo "$1 v$2 (@PACKAGE@ @VERSION@)"
17 $ECHO "@WARRANTY@" | sed -e 's/\n/ /g' 11 printf '%b' "@WARRANTY@"
18} 12}
19 13
20support() { 14support() {
21 $ECHO "@SUPPORT@" | sed -e 's/\n/ /g' 15 printf '%b' "@SUPPORT@"
22} 16}
23 17
24# 18#