1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-12-22 09:03:54 +01:00

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

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=$?