mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-11-22 10:23:46 +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
|
# crit2warn.sh is a wrapper for Nagios checks that changes the return
|
||||||
# code for checks from CRITICAL to WARNING
|
# code for checks from CRITICAL to WARNING
|
||||||
|
|
||||||
CMD=""
|
CMD=""
|
||||||
|
|
||||||
# Quote arguments
|
# Quote arguments
|
||||||
for (( i = 1; i < $# ; i++ )); do
|
while (( "$#" > 0 )); do
|
||||||
eval ARG=\$$i
|
ARG=$1
|
||||||
|
shift
|
||||||
CMD="$CMD $(echo "$ARG" | awk '{gsub(".", "\\\\&");print}')"
|
CMD="$CMD $(echo "$ARG" | awk '{gsub(".", "\\\\&");print}')"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Run command
|
# Run command
|
||||||
eval "echo $CMD >> /tmp/cmd"
|
|
||||||
eval "$CMD"
|
eval "$CMD"
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user