File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 53
53
# 20220909 1.10.0 Allow ignoring statuses on workload checks (#29) #
54
54
# 20230110 1.11.0 Allow ignoring workload names, provisioning cluster not critical (#39) #
55
55
# 20230202 1.12.0 Add local-certs check type #
56
+ # 20231208 1.12.1 Use 'command -v' instead of 'which' for required command check #
56
57
# #########################################################################################
57
58
# (Pre-)Define some fixed variables
58
59
STATE_OK=0 # define the exit code if status is OK
@@ -61,7 +62,7 @@ STATE_CRITICAL=2 # define the exit code if status is Critical
61
62
STATE_UNKNOWN=3 # define the exit code if status is Unknown
62
63
export PATH=/usr/local/bin:/usr/bin:/bin:$PATH # Set path
63
64
proto=http # Protocol to use, default is http, can be overwritten with -S parameter
64
- version=1.12.0
65
+ version=1.12.1
65
66
# #########################################################################################
66
67
# functions
67
68
@@ -190,7 +191,7 @@ exit ${STATE_UNKNOWN}
190
191
# ########################################################################
191
192
# Check for necessary commands
192
193
for cmd in jq curl; do
193
- if ! ` which ${cmd} 1> /dev/null` ; then
194
+ if ! ` command -v ${cmd} 1> /dev/null` ; then
194
195
echo " UNKNOWN: ${cmd} does not exist, please check if command exists and PATH is correct"
195
196
exit ${STATE_UNKNOWN}
196
197
fi
You can’t perform that action at this time.
0 commit comments