Added support for more than 9 arguments to crit2warn wrapper

This commit is contained in:
Tómas Edwardsson 2010-03-04 14:33:22 +00:00
parent 5a5915e5de
commit 1928196840
1 changed files with 3 additions and 4 deletions

View File

@ -17,17 +17,16 @@
# crit2warn.sh is a wrapper for Nagios checks that changes the return
# code for checks from CRITICAL to WARNING
CMD=""
# Quote arguments
for (( i = 1; i < $# ; i++ )); do
eval ARG=\$$i
while (( "$#" > 0 )); do
ARG=$1
shift
CMD="$CMD $(echo "$ARG" | awk '{gsub(".", "\\\\&");print}')"
done
# Run command
eval "echo $CMD >> /tmp/cmd"
eval "$CMD"
ret=$?