mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-11-22 02:13:44 +01:00
Added support for more than 9 arguments to crit2warn wrapper
This commit is contained in:
parent
5a5915e5de
commit
1928196840
@ -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=$?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user